Skip to content

Commit 0a298d1

Browse files
dinghaoliukuba-moo
authored andcommitted
net: qlcnic: add missed unlock in qlcnic_83xx_flash_read32
qlcnic_83xx_unlock_flash() is called on all paths after we call qlcnic_83xx_lock_flash(), except for one error path on failure of QLCRD32(), which may cause a deadlock. This bug is suggested by a static analysis tool, please advise. Fixes: 81d0aeb ("qlcnic: flash template based firmware reset recovery") Signed-off-by: Dinghao Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 276e189 commit 0a298d1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3156,8 +3156,10 @@ int qlcnic_83xx_flash_read32(struct qlcnic_adapter *adapter, u32 flash_addr,
31563156

31573157
indirect_addr = QLC_83XX_FLASH_DIRECT_DATA(addr);
31583158
ret = QLCRD32(adapter, indirect_addr, &err);
3159-
if (err == -EIO)
3159+
if (err == -EIO) {
3160+
qlcnic_83xx_unlock_flash(adapter);
31603161
return err;
3162+
}
31613163

31623164
word = ret;
31633165
*(u32 *)p_data = word;

0 commit comments

Comments
 (0)