diff options
-rw-r--r-- | drivers/scsi/scsi.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index ebc019380835..54ff611b8677 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c | |||
@@ -319,17 +319,16 @@ int scsi_setup_command_freelist(struct Scsi_Host *shost) | |||
319 | GFP_KERNEL | shost->cmd_pool->gfp_mask); | 319 | GFP_KERNEL | shost->cmd_pool->gfp_mask); |
320 | if (!cmd) | 320 | if (!cmd) |
321 | goto fail2; | 321 | goto fail2; |
322 | list_add(&cmd->list, &shost->free_list); | 322 | list_add(&cmd->list, &shost->free_list); |
323 | return 0; | 323 | return 0; |
324 | 324 | ||
325 | fail2: | 325 | fail2: |
326 | mutex_lock(&host_cmd_pool_mutex); | ||
326 | if (!--pool->users) | 327 | if (!--pool->users) |
327 | kmem_cache_destroy(pool->slab); | 328 | kmem_cache_destroy(pool->slab); |
328 | return -ENOMEM; | ||
329 | fail: | 329 | fail: |
330 | mutex_unlock(&host_cmd_pool_mutex); | 330 | mutex_unlock(&host_cmd_pool_mutex); |
331 | return -ENOMEM; | 331 | return -ENOMEM; |
332 | |||
333 | } | 332 | } |
334 | 333 | ||
335 | /** | 334 | /** |