Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 166a7287 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by James Bottomley
Browse files

[SCSI] fix scsi_setup_command_freelist failure path race



Looks like that host_cmd_pool_mutex are necessary here.

Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 210ba1d1
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -323,13 +323,12 @@ int scsi_setup_command_freelist(struct Scsi_Host *shost)
	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;

}

/**