[PATCH] dc395x [5/6] - check for device

Jamie Lenehan
2003-08-21T10:17:29Z

After searching for a device to free, only free it if it was found.

diff -du -r a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
--- a/drivers/scsi/dc395x.c 2003-08-20 21:38:20.141105272 +1000
+++ b/drivers/scsi/dc395x.c 2003-08-20 21:38:26.892078968 +1000
@@ -4833,7 +4833,8 @@
{
struct AdapterCtlBlk *acb = (struct AdapterCtlBlk *)scsi_device->host->hostdata;
struct DeviceCtlBlk *dcb = find_dcb(acb, scsi_device->id, scsi_device->lun);
- adapter_remove_and_free_device(acb, dcb);
+ if (dcb)
+ adapter_remove_and_free_device(acb, dcb);
}