[PATCH 1/3] UBI: do not compare array with NULL

Artem Bityutskiy dedekind1 at gmail.com
Mon Mar 28 03:36:09 EDT 2011


From: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>

Coverity spotted that UBI debugging code tries to compare
an array and NULL, which obviously makes little sense. Kill
this check.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
---
 drivers/mtd/ubi/vmt.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index b79e0de..366eb70 100644
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -790,11 +790,6 @@ static int paranoid_check_volume(struct ubi_device *ubi, int vol_id)
 		goto fail;
 	}
 
-	if (!vol->name) {
-		ubi_err("NULL volume name");
-		goto fail;
-	}
-
 	n = strnlen(vol->name, vol->name_len + 1);
 	if (n != vol->name_len) {
 		ubi_err("bad name_len %lld", n);
-- 
1.7.2.3




More information about the linux-mtd mailing list