Skip to content

Commit

Permalink
[SCSI] qla4xxx: Fix srb lookup in qla4xxx_eh_device_reset
Browse files Browse the repository at this point in the history
eh_device_reset may be called from scsi error handler or sg_reset, etc.
When called from sg_reset, there will not be an associated srb.  The
driver should lookup the corresponding device handle given information
from the supplied cmd structure and should not assume that there exists
an srb.

Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
  • Loading branch information
Karen Higgins authored and James Bottomley committed Jul 30, 2009
1 parent dca05c4 commit 612f734
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/scsi/qla4xxx/ql4_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -1543,11 +1543,9 @@ static int qla4xxx_eh_device_reset(struct scsi_cmnd *cmd)
{
struct scsi_qla_host *ha = to_qla_host(cmd->device->host);
struct ddb_entry *ddb_entry = cmd->device->hostdata;
struct srb *sp;
int ret = FAILED, stat;

sp = (struct srb *) cmd->SCp.ptr;
if (!sp || !ddb_entry)
if (!ddb_entry)
return ret;

dev_info(&ha->pdev->dev,
Expand Down

0 comments on commit 612f734

Please sign in to comment.