]> git.baikalelectronics.ru Git - kernel.git/commit
UBI: fix error path in __wl_get_peb
authorTanya Brokhman <tlinder@codeaurora.org>
Tue, 1 Apr 2014 08:01:12 +0000 (11:01 +0300)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Mon, 5 May 2014 06:31:33 +0000 (09:31 +0300)
commit51bc263651f71e12de65376cf8efe1abf6cac6d3
tree465df391e8858ae8575a2bf72815e4302ab83386
parentc1f4d524cd7de22aa87dfe8808738a4a40843d41
UBI: fix error path in __wl_get_peb

In case of an error (if there are not free PEB's for example),
__wl_get_peb will return a negative value. In order to prevent access
violation we need to test the returned value prior to using it later on.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/mtd/ubi/wl.c