]> git.baikalelectronics.ru Git - kernel.git/commit
staging: zram: prevent accessing an unallocated table when init fails early
authorJerome Marchand <jmarchan@redhat.com>
Tue, 6 Sep 2011 13:02:12 +0000 (15:02 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Sep 2011 23:56:16 +0000 (16:56 -0700)
commitac84b5fdc542355800f7c465fcf404c3dc40ded3
treef0a801f1e99b8d3bfdb6c1cf2f3be5f6345f8778
parent500511c3301372bed87e01fd81939e57a722775b
staging: zram: prevent accessing an unallocated table when init fails early

When the allocation of zram->table fails, we set zram->disksize to zero
to prevent accessing the unallocated table entries during cleanup.
However, we currently don't take this precaution when the initialization
fails earlier.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/zram/zram_drv.c