Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=166a72878f76e911f2d1ce4b2310d4403e94be11
Commit:     166a72878f76e911f2d1ce4b2310d4403e94be11
Parent:     210ba1d1724f5c4ed87a2ab1a21ca861a915f734
Author:     FUJITA Tomonori <[EMAIL PROTECTED]>
AuthorDate: Tue Jan 8 07:59:05 2008 +0900
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Fri Jan 11 18:29:18 2008 -0600

    [SCSI] fix scsi_setup_command_freelist failure path race
    
    Looks like that host_cmd_pool_mutex are necessary here.
    
    Signed-off-by: FUJITA Tomonori <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 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 ebc0193..54ff611 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -319,17 +319,16 @@ int scsi_setup_command_freelist(struct Scsi_Host *shost)
                        GFP_KERNEL | shost->cmd_pool->gfp_mask);
        if (!cmd)
                goto fail2;
-       list_add(&cmd->list, &shost->free_list);                
+       list_add(&cmd->list, &shost->free_list);
        return 0;
 
  fail2:
+       mutex_lock(&host_cmd_pool_mutex);
        if (!--pool->users)
                kmem_cache_destroy(pool->slab);
-       return -ENOMEM;
  fail:
        mutex_unlock(&host_cmd_pool_mutex);
        return -ENOMEM;
-
 }
 
 /**
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to