[PATCH][V2] UBI: block: fix dereference on uninitialized dev

Ezequiel Garcia ezequiel.garcia at free-electrons.com
Thu Aug 21 12:12:46 PDT 2014


On 20 Aug 10:19 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> commit 4df38926f337 ("UBI: block: Avoid disk size integer overflow")
> introduced a dereference on dev (which is not initialized at that
> point) when printing a warning message.  Re-order disk_capacity check
> after the dev is found.
> 
> Found by cppcheck:
>  [drivers/mtd/ubi/block.c:509]: (error) Uninitialized variable: dev
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>

Acked-by: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>

Thanks a lot,
-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com



More information about the linux-mtd mailing list