Skip to content

Commit

Permalink
[SCSI] mptspi: fix oops in mptspi_dv_renegotiate_work()
Browse files Browse the repository at this point in the history
The problem here is that if the ioc faults too early in the bring up
sequence (as it usually does for an irq routing problem), ioc_reset gets
called before the scsi host is even allocated.  This causes an oops when
it later schedules a renegotiation.  Fix this by checking ioc->sh before
trying to renegotiate.

Cc: "Moore, Eric" <[email protected]>
Cc: Stable Tree <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
James Bottomley authored and James Bottomley committed Jul 8, 2008
1 parent bdb2b8c commit 081a5bc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/message/fusion/mptspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1266,13 +1266,18 @@ mptspi_dv_renegotiate(struct _MPT_SCSI_HOST *hd)
static int
mptspi_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
{
struct _MPT_SCSI_HOST *hd = shost_priv(ioc->sh);
int rc;

rc = mptscsih_ioc_reset(ioc, reset_phase);

if (reset_phase == MPT_IOC_POST_RESET)
/* only try to do a renegotiation if we're properly set up
* if we get an ioc fault on bringup, ioc->sh will be NULL */
if (reset_phase == MPT_IOC_POST_RESET &&
ioc->sh) {
struct _MPT_SCSI_HOST *hd = shost_priv(ioc->sh);

mptspi_dv_renegotiate(hd);
}

return rc;
}
Expand Down

0 comments on commit 081a5bc

Please sign in to comment.