Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88159
b: refs/heads/master
c: 164fc5d
h: refs/heads/master
i:
  88157: 74ff8f8
  88155: c40e22a
  88151: 0c1d3ab
  88143: 25ade8f
  88127: ab9c127
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Apr 6, 2008
1 parent caf9a01 commit e8684f2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 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: 797de7bdb253624c16144f40b72ec65d63cdcca2
refs/heads/master: 164fc5dcd6a1026fc713f5c63fad899aa484888c
22 changes: 12 additions & 10 deletions trunk/drivers/scsi/scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,18 @@ struct scsi_cmnd *__scsi_get_command(struct Scsi_Host *shost, gfp_t gfp_mask)
cmd = kmem_cache_alloc(shost->cmd_pool->cmd_slab,
gfp_mask | shost->cmd_pool->gfp_mask);

if (likely(cmd)) {
buf = kmem_cache_alloc(shost->cmd_pool->sense_slab,
gfp_mask | shost->cmd_pool->gfp_mask);
if (likely(buf)) {
memset(cmd, 0, sizeof(*cmd));
cmd->sense_buffer = buf;
} else {
kmem_cache_free(shost->cmd_pool->cmd_slab, cmd);
cmd = NULL;
}
}

if (unlikely(!cmd)) {
unsigned long flags;

Expand All @@ -197,16 +209,6 @@ struct scsi_cmnd *__scsi_get_command(struct Scsi_Host *shost, gfp_t gfp_mask)
memset(cmd, 0, sizeof(*cmd));
cmd->sense_buffer = buf;
}
} else {
buf = kmem_cache_alloc(shost->cmd_pool->sense_slab,
gfp_mask | shost->cmd_pool->gfp_mask);
if (likely(buf)) {
memset(cmd, 0, sizeof(*cmd));
cmd->sense_buffer = buf;
} else {
kmem_cache_free(shost->cmd_pool->cmd_slab, cmd);
cmd = NULL;
}
}

return cmd;
Expand Down

0 comments on commit e8684f2

Please sign in to comment.