Colin Ian King 3df7707253 UBI: block: fix dereference on uninitialized dev
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

Artem: tweak the error message a bit

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2014-09-16 19:02:04 +03:00
..
2014-01-02 17:16:01 +02:00
2012-10-03 12:29:37 +03:00
2012-09-04 09:39:01 +03:00
2014-04-07 10:17:30 -07:00
2012-12-10 13:38:59 +02:00
2014-07-28 19:07:33 +03:00