]> git.karo-electronics.de Git - linux-beck.git/commit
pstore/ram_core: Better ECC size checking
authorAnton Vorontsov <anton.vorontsov@linaro.org>
Tue, 19 Jun 2012 02:15:53 +0000 (19:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Jun 2012 23:15:22 +0000 (16:15 -0700)
commit1e6a9e56252399ae8c143f2327b4bb8cd289c3d5
treee4dfb2629ec406052214197f8610ec5fbb39c724
parentbeeb94321a7a6d493b4a06ff0cd771f09f41c35e
pstore/ram_core: Better ECC size checking

- Instead of exploiting unsigned overflows (which doesn't work for all
  sizes), use straightforward checking for ECC total size not exceeding
  initial buffer size;

- Printing overflowed buffer_size is not informative. Instead, print
  ecc_size and buffer_size;

- No need for buffer_size argument in persistent_ram_init_ecc(),
  we can address prz->buffer_size directly.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/pstore/ram_core.c