Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181397
b: refs/heads/master
c: 77c9cfc
h: refs/heads/master
i:
  181395: 0f00208
v: v3
  • Loading branch information
Martin K. Petersen authored and James Bottomley committed Feb 19, 2010
1 parent 067e40f commit 0c26c80
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8475f688d796b875bf98ed161acd53d00a1483ff
refs/heads/master: 77c9cfc51b0d732b2524799810fb30018074fd60
3 changes: 3 additions & 0 deletions trunk/drivers/scsi/constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ void scsi_print_command(struct scsi_cmnd *cmd)
{
int k;

if (cmd->cmnd == NULL)
return;

scmd_printk(KERN_INFO, cmd, "CDB: ");
print_opcode_name(cmd->cmnd, cmd->cmd_len);

Expand Down
13 changes: 12 additions & 1 deletion trunk/drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1209,8 +1209,19 @@ static int sd_done(struct scsi_cmnd *SCpnt)
sd_dif_complete(SCpnt, good_bytes);

if (scsi_host_dif_capable(sdkp->device->host, sdkp->protection_type)
== SD_DIF_TYPE2_PROTECTION && SCpnt->cmnd != SCpnt->request->cmd)
== SD_DIF_TYPE2_PROTECTION && SCpnt->cmnd != SCpnt->request->cmd) {

/* We have to print a failed command here as the
* extended CDB gets freed before scsi_io_completion()
* is called.
*/
if (result)
scsi_print_command(SCpnt);

mempool_free(SCpnt->cmnd, sd_cdb_pool);
SCpnt->cmnd = NULL;
SCpnt->cmd_len = 0;
}

return good_bytes;
}
Expand Down

0 comments on commit 0c26c80

Please sign in to comment.