summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.c
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2010-02-04 15:43:36 +0100
committerJames Bottomley <James.Bottomley@suse.de>2010-02-17 20:23:03 +0100
commit23231048309ea8eed0189f1eb8f870f08703cac0 (patch)
treea20af6308d43163db7a9891d40add49534fb12bf /drivers/scsi/hpsa.c
parent[SCSI] hpsa: clarify obscure comment in adjust_hpsa_scsi_table (diff)
downloadlinux-23231048309ea8eed0189f1eb8f870f08703cac0.tar.xz
linux-23231048309ea8eed0189f1eb8f870f08703cac0.zip
[SCSI] hpsa: Fix hpsa_find_scsi_entry so that it doesn't try to dereference NULL pointers
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 42295c49682f..2764cb605693 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -776,6 +776,8 @@ static int hpsa_scsi_find_entry(struct hpsa_scsi_dev_t *needle,
#define DEVICE_CHANGED 1
#define DEVICE_SAME 2
for (i = 0; i < haystack_size; i++) {
+ if (haystack[i] == NULL) /* previously removed. */
+ continue;
if (SCSI3ADDR_EQ(needle->scsi3addr, haystack[i]->scsi3addr)) {
*index = i;
if (device_is_the_same(needle, haystack[i]))