]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] pm8001: potential null dereference in pm8001_dev_gone_notify()
authorDan Carpenter <error27@gmail.com>
Fri, 23 Apr 2010 12:01:04 +0000 (14:01 +0200)
committerJames Bottomley <James.Bottomley@suse.de>
Sun, 2 May 2010 15:04:23 +0000 (11:04 -0400)
commitfbaccd78166c5914523a9d96c4daea35cba62580
tree09a540d9c6f5b0c7e2bd80ad12f3b6864e7d142d
parent9ed47072c30944d63e55b4ed45dceddde1e23d38
[SCSI] pm8001: potential null dereference in pm8001_dev_gone_notify()

In the original code we dereferenced "pm8001_dev" before checking if it
was null.  This patch moves the dereference inside the condition.

This was found by a static checker (smatch).  I looked, but I couldn't
tell if "pm8001_dev" dev was ever actually null.  The approach in this
patch seemed like the safest response.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/pm8001/pm8001_sas.c