Skip to contentSkip to conversation

staging: gpib: Add missing mutex unlock in agilent usb driver

PATCH New Dave Penkler 1 participant 1 message Jan 11, 2025 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 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'.

Fixes 4c41fe886a56 ("staging: gpib: Add Agilent/Keysight 82357x USB GPIB driver")

---
v1 -> v2 Add subsystem prefix in subject

drivers/staging/gpib/agilent_82357a/agilent_82357a.c | 1 +

 1 file changed, 1 insertion(+)
drivers/staging/gpib/agilent_82357a/agilent_82357a.c +1 -0
index b21eadabc466..c22c6bb30776 100644
@@ -1365,6 +1365,7 @@ static int agilent_82357a_attach(gpib_board_t *board, const gpib_board_config_t
 		break;
 	default:
 		dev_err(&usb_dev->dev, "bug, unhandled product_id in switch?\n");
+		mutex_unlock(&agilent_82357a_hotplug_lock);
 		return -EIO;
 	}
 #ifdef RESET_USB_CONFIG
Signature · 1 line
2.47.1