Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 167226
b: refs/heads/master
c: b4c2554
h: refs/heads/master
v: v3
  • Loading branch information
Martin K. Petersen authored and James Bottomley committed Oct 2, 2009
1 parent cf68bcd commit 9cd4a39
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 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: 35e1a5d90b66487d754ef2f2dcbf1007f806d921
refs/heads/master: b4c2554d40ceac130a8d062eaa8838ed22158c45
11 changes: 7 additions & 4 deletions trunk/drivers/scsi/scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,7 @@ scsi_host_alloc_command(struct Scsi_Host *shost, gfp_t gfp_mask)
*/
struct scsi_cmnd *__scsi_get_command(struct Scsi_Host *shost, gfp_t gfp_mask)
{
struct scsi_cmnd *cmd;
unsigned char *buf;

cmd = scsi_host_alloc_command(shost, gfp_mask);
struct scsi_cmnd *cmd = scsi_host_alloc_command(shost, gfp_mask);

if (unlikely(!cmd)) {
unsigned long flags;
Expand All @@ -258,9 +255,15 @@ struct scsi_cmnd *__scsi_get_command(struct Scsi_Host *shost, gfp_t gfp_mask)
spin_unlock_irqrestore(&shost->free_list_lock, flags);

if (cmd) {
void *buf, *prot;

buf = cmd->sense_buffer;
prot = cmd->prot_sdb;

memset(cmd, 0, sizeof(*cmd));

cmd->sense_buffer = buf;
cmd->prot_sdb = prot;
}
}

Expand Down

0 comments on commit 9cd4a39

Please sign in to comment.