[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110115140300.GC2721@bicker>
Date: Sat, 15 Jan 2011 17:03:00 +0300
From: Dan Carpenter <error27@...il.com>
To: "Nicholas A. Bellinger" <nab@...ux-iscsi.org>
Cc: James Bottomley <James.Bottomley@...e.de>,
linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [patch] [SCSI] target: checking for NULL instead of IS_ERR
blkdev_get_by_path() returns an ERR_PTR() or error and it doesn't return
a NULL. It looks like this bug would be easy to trigger by mistake.
Signed-off-by: Dan Carpenter <error27@...il.com>
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index c6e0d75..3456135 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -154,7 +154,7 @@ static struct se_device *iblock_create_virtdevice(
bd = blkdev_get_by_path(ib_dev->ibd_udev_path,
FMODE_WRITE|FMODE_READ|FMODE_EXCL, ib_dev);
- if (!(bd))
+ if (IS_ERR(bd))
goto failed;
/*
* Setup the local scope queue_limits from struct request_queue->limits
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists