[SCSI] pm8001:fix potential NULL pointer dereference

Signed-off-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:
jack wang 2009-12-07 17:22:55 +08:00 committed by James Bottomley
parent 0330dba361
commit f01f4e6a1c
1 changed files with 1 additions and 1 deletions

View File

@ -616,11 +616,11 @@ static int pm8001_dev_found_notify(struct domain_device *dev)
spin_lock_irqsave(&pm8001_ha->lock, flags);
pm8001_device = pm8001_alloc_dev(pm8001_ha);
pm8001_device->sas_device = dev;
if (!pm8001_device) {
res = -1;
goto found_out;
}
pm8001_device->sas_device = dev;
dev->lldd_dev = pm8001_device;
pm8001_device->dev_type = dev->dev_type;
pm8001_device->dcompletion = &completion;