]> Git Repo - linux.git/commitdiff
pstore/ram: (really) fix undefined usage of rounddown_pow_of_two
authorMaxime Bizon <[email protected]>
Fri, 30 Aug 2013 16:06:41 +0000 (18:06 +0200)
committerTony Luck <[email protected]>
Fri, 30 Aug 2013 22:57:01 +0000 (15:57 -0700)
Previous attempt to fix was b042e47491ba5f487601b5141a3f1d8582304170

Suggested use of is_power_of_2() was bogus because is_power_of_2(0) is
false (documented behaviour).

Signed-off-by: Maxime Bizon <[email protected]>
Acked-by: Kees Cook <[email protected]>
Signed-off-by: Tony Luck <[email protected]>
fs/pstore/ram.c

index 4027c2065842d488755e2cadbc6bbdf62b171e39..fa8cef2cca3af73044cec32e409302895ea4891d 100644 (file)
@@ -421,11 +421,11 @@ static int ramoops_probe(struct platform_device *pdev)
                goto fail_out;
        }
 
-       if (!is_power_of_2(pdata->record_size))
+       if (pdata->record_size && !is_power_of_2(pdata->record_size))
                pdata->record_size = rounddown_pow_of_two(pdata->record_size);
-       if (!is_power_of_2(pdata->console_size))
+       if (pdata->console_size && !is_power_of_2(pdata->console_size))
                pdata->console_size = rounddown_pow_of_two(pdata->console_size);
-       if (!is_power_of_2(pdata->ftrace_size))
+       if (pdata->ftrace_size && !is_power_of_2(pdata->ftrace_size))
                pdata->ftrace_size = rounddown_pow_of_two(pdata->ftrace_size);
 
        cxt->dump_read_cnt = 0;
This page took 0.056885 seconds and 4 git commands to generate.