Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95818
b: refs/heads/master
c: 61d7416
h: refs/heads/master
v: v3
  • Loading branch information
Alan D. Brunelle authored and James Bottomley committed Apr 30, 2008
1 parent 135fd10 commit 84f7325
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 49dd09613cf8ae3b697c341c501b7526b462cfeb
refs/heads/master: 61d7416a286e840d905c18b1e6b0977c036c8656
8 changes: 8 additions & 0 deletions trunk/drivers/scsi/scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ int scsi_setup_command_freelist(struct Scsi_Host *shost)
cmd = scsi_pool_alloc_command(shost->cmd_pool, gfp_mask);
if (!cmd) {
scsi_put_host_cmd_pool(gfp_mask);
shost->cmd_pool = NULL;
return -ENOMEM;
}
list_add(&cmd->list, &shost->free_list);
Expand All @@ -481,6 +482,13 @@ int scsi_setup_command_freelist(struct Scsi_Host *shost)
*/
void scsi_destroy_command_freelist(struct Scsi_Host *shost)
{
/*
* If cmd_pool is NULL the free list was not initialized, so
* do not attempt to release resources.
*/
if (!shost->cmd_pool)
return;

while (!list_empty(&shost->free_list)) {
struct scsi_cmnd *cmd;

Expand Down

0 comments on commit 84f7325

Please sign in to comment.