summaryrefslogtreecommitdiff
path: root/virt
diff options
context:
space:
mode:
authorMaxime Bizon <mbizon@freebox.fr>2012-10-22 13:19:28 +0400
committerAnton Vorontsov <anton.vorontsov@linaro.org>2012-11-18 05:40:57 +0400
commitb042e47491ba5f487601b5141a3f1d8582304170 (patch)
tree3dd470e6eef9dc87c478a047850b3da718794ab2 /virt
parent53f21a8ea1d76a002103ce20abd168fe83b20ee7 (diff)
downloadlinux-b042e47491ba5f487601b5141a3f1d8582304170.tar.xz
pstore/ram: Fix undefined usage of rounddown_pow_of_two(0)
record_size / console_size / ftrace_size can be 0 (this is how you disable the feature), but rounddown_pow_of_two(0) is undefined. As suggested by Kees Cook, use !is_power_of_2() as a condition to call rounddown_pow_of_two and avoid its undefined behavior on the value 0. This issue has been present since commit 1894a253 (ramoops: Move to fs/pstore/ram.c). Cc: stable@vger.kernel.org Signed-off-by: Maxime Bizon <mbizon@freebox.fr> Signed-off-by: Florian Fainelli <ffainelli@freebox.fr> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Diffstat (limited to 'virt')
0 files changed, 0 insertions, 0 deletions