Commit 85dc98d93f3dc41cce54118a7abab9e6aa616dd2
Committed by
James Bottomley
1 parent
29fe609d12
Exists in
master
and in
7 other branches
[SCSI] target: fixed missing lock drop in error path
The struct se_node_acl->device_list_lock needs to be released if either sanity check for struct se_dev_entry->se_lun_acl or deve->se_lun fails. Signed-off-by: Fubo Chen <fubo.chen@gmail.com> Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff
drivers/target/target_core_device.c
... | ... | @@ -395,12 +395,14 @@ |
395 | 395 | printk(KERN_ERR "struct se_dev_entry->se_lun_acl" |
396 | 396 | " already set for demo mode -> explict" |
397 | 397 | " LUN ACL transition\n"); |
398 | + spin_unlock_irq(&nacl->device_list_lock); | |
398 | 399 | return -1; |
399 | 400 | } |
400 | 401 | if (deve->se_lun != lun) { |
401 | 402 | printk(KERN_ERR "struct se_dev_entry->se_lun does" |
402 | 403 | " match passed struct se_lun for demo mode" |
403 | 404 | " -> explict LUN ACL transition\n"); |
405 | + spin_unlock_irq(&nacl->device_list_lock); | |
404 | 406 | return -1; |
405 | 407 | } |
406 | 408 | deve->se_lun_acl = lun_acl; |