Skip to content

Commit 55eb3c3

Browse files
dpenklergregkh
authored andcommitted
staging: gpib: Add missing mutex unlock in agilent usb driver
When no matching product id was found in the attach function the driver returned without unlocking the agilent_82357a_hotplug_lock mutex. Add the unlock call. This was detected by smatch: smatch warnings: drivers/staging/gpib/agilent_82357a/agilent_82357a.c:1381 agilent_82357a_attach() warn: inconsistent returns 'global &agilent_82357a_hotplug_lock'. Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Fixes: 4c41fe8 ("staging: gpib: Add Agilent/Keysight 82357x USB GPIB driver") Signed-off-by: Dave Penkler <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 95cfc75 commit 55eb3c3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/staging/gpib/agilent_82357a/agilent_82357a.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,6 +1365,7 @@ static int agilent_82357a_attach(gpib_board_t *board, const gpib_board_config_t
13651365
break;
13661366
default:
13671367
dev_err(&usb_dev->dev, "bug, unhandled product_id in switch?\n");
1368+
mutex_unlock(&agilent_82357a_hotplug_lock);
13681369
return -EIO;
13691370
}
13701371
#ifdef RESET_USB_CONFIG

0 commit comments

Comments
 (0)