From: Doug Ledford <dledford@redhat.com> Date: Mon, 25 Aug 2008 13:54:18 -0400 Subject: [scsi] mptscsi: check for null device in error handler Message-id: 1219686858.16580.18.camel@firewall.xsintricity.com O-Subject: [Patch RHEL5.3] Fix oops in mptscsi driver Bugzilla: 441832 RH-Acked-by: Pete Zaitcev <zaitcev@redhat.com> RH-Acked-by: David Milburn <dmilburn@redhat.com> We can be called with a NULL device struct if we are an error handler thread getting woke up after the device in question has already been removed. So, check for a null device and return success if we've already been removed. Fixes bz441832. Also available via git at: git pull git://git.engineering.redhat.com/users/dledford/rhel5-kernel.git bz441832 -- Doug Ledford <dledford@redhat.com> GPG KeyID: CFBFF194 http://people.redhat.com/dledford Infiniband specific RPMs available at http://people.redhat.com/dledford/Infiniband commit 6760813690f162d093765b046843996c0b277b88 Author: Doug Ledford <dledford@redhat.com> Date: Mon Aug 25 13:32:53 2008 -0400 Fix for oops in mptscsih_bus_reset Signed-off-by: Doug Ledford <dledford@redhat.com> diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index f3d112c..acb9463 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c @@ -1980,6 +1980,9 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt) hd->timeouts++; vdevice = SCpnt->device->hostdata; + if (!vdevice || !vdevice->vtarget) + return SUCCESS; + retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS, vdevice->vtarget->channel, 0, 0, 0, mptscsih_get_tm_timeout(ioc));