Skip to contentSkip to conversation

s390/ap: fixes bug in the AP bus's __verify_queue_reservations function

PATCH In review Tony Krowiak 2 participants 3 messages Jul 6, 2022 – Jul 11, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390/ap: fixes bug in the AP bus's __verify_queue_reservations function

The AP bus's __verify_queue_reservations function increments the ref count for the device driver passed in as a parameter, but fails to decrement it before returning control to the caller. This will prevents any subsequent removal of the module.

---
 drivers/s390/crypto/ap_bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/crypto/ap_bus.c +1 -1
index 5c13d2079d96..0a9045b49c50 100644
@@ -1435,7 +1435,7 @@ static int __verify_queue_reservations(struct device_driver *drv, void *data)
 	if (ap_drv->in_use) {
 		rc = ap_drv->in_use(ap_perms.apm, newaqm);
 		if (rc)
-			return -EBUSY;
+			rc = -EBUSY;
 	}
 
 	/* release the driver's module */
Signature · 1 line
2.31.1
#1 lore raw
Quoted 24 lines · Tony Krowiak

The AP bus's __verify_queue_reservations function increments the ref count for the device driver passed in as a parameter, but fails to decrement it before returning control to the caller. This will prevents any subsequent removal of the module.

---
 drivers/s390/crypto/ap_bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/crypto/ap_bus.c +1 -1
index 5c13d2079d96..0a9045b49c50 100644
@@ -1435,7 +1435,7 @@ static int __verify_queue_reservations(struct
 device_driver *drv, void *data)
 	if (ap_drv->in_use) {
 		rc = ap_drv->in_use(ap_perms.apm, newaqm);
 		if (rc)
-			return -EBUSY;
+			rc = -EBUSY;
 	}
 
Quoted 1 line

/* release the driver's module */

Tony, good catch. Thanks. Please add my Reviewed-by: Harald Freudenberger <[email protected]> and then commit into devel and cc stable.

#2 lore raw
Quoted 25 lines · Harald Freudenberger
Quoted 24 lines · Tony Krowiak

The AP bus's __verify_queue_reservations function increments the ref count for the device driver passed in as a parameter, but fails to decrement it before returning control to the caller. This will prevents any subsequent removal of the module.

---
 drivers/s390/crypto/ap_bus.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/crypto/ap_bus.c +1 -1
index 5c13d2079d96..0a9045b49c50 100644
@@ -1435,7 +1435,7 @@ static int __verify_queue_reservations(struct
 device_driver *drv, void *data)
      if (ap_drv->in_use) {
          rc = ap_drv->in_use(ap_perms.apm, newaqm);
          if (rc)
-            return -EBUSY;
+            rc = -EBUSY;
      }
 
Quoted 3 lines
Quoted 1 line

     /* release the driver's module */

Tony, good catch. Thanks. Please add my Reviewed-by: Harald Freudenberger <[email protected]> and then commit into devel and cc stable.

It is done.