Skip to content

Commit

Permalink
[SCSI] isci: remove unused 'isci_tmf->device' field
Browse files Browse the repository at this point in the history
As the field was never set, isci_print_tmf() using 'isci_tmf->device'
sometimes causes a kernel crash if the dev_dbg() statement is enabled.
Remove the unused field both from isci_tmf struct definition and from
isci_print_tmf()

Signed-off-by: Maciej Trela <maciej.trela@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Maciej Trela authored and James Bottomley committed Jan 16, 2012
1 parent be168a3 commit 27234ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers/scsi/isci/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ static int isci_task_execute_tmf(struct isci_host *ihost,
}
}

isci_print_tmf(tmf);
isci_print_tmf(ihost, tmf);

if (tmf->status == SCI_SUCCESS)
ret = TMF_RESP_FUNC_COMPLETE;
Expand Down
7 changes: 3 additions & 4 deletions drivers/scsi/isci/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ struct isci_tmf {
} resp;
unsigned char lun[8];
u16 io_tag;
struct isci_remote_device *device;
enum isci_tmf_function_codes tmf_code;
int status;

Expand All @@ -120,10 +119,10 @@ struct isci_tmf {

};

static inline void isci_print_tmf(struct isci_tmf *tmf)
static inline void isci_print_tmf(struct isci_host *ihost, struct isci_tmf *tmf)
{
if (SAS_PROTOCOL_SATA == tmf->proto)
dev_dbg(&tmf->device->isci_port->isci_host->pdev->dev,
dev_dbg(&ihost->pdev->dev,
"%s: status = %x\n"
"tmf->resp.d2h_fis.status = %x\n"
"tmf->resp.d2h_fis.error = %x\n",
Expand All @@ -132,7 +131,7 @@ static inline void isci_print_tmf(struct isci_tmf *tmf)
tmf->resp.d2h_fis.status,
tmf->resp.d2h_fis.error);
else
dev_dbg(&tmf->device->isci_port->isci_host->pdev->dev,
dev_dbg(&ihost->pdev->dev,
"%s: status = %x\n"
"tmf->resp.resp_iu.data_present = %x\n"
"tmf->resp.resp_iu.status = %x\n"
Expand Down

0 comments on commit 27234ab

Please sign in to comment.