Skip to content

Commit 2f23256

Browse files
Tony KrowiakAlexander Gordeev
authored andcommitted
s390/ap: fix error handling in __verify_queue_reservations()
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. Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com> Reported-by: Tony Krowiak <akrowiak@linux.ibm.com> Reviewed-by: Harald Freudenberger <freude@linux.ibm.com> Fixes: 4f8206b ("s390/ap: driver callback to indicate resource in use") Link: https://lore.kernel.org/r/20220706222619.602094-1-akrowiak@linux.ibm.com Cc: stable@vger.kernel.org [agordeev@linux.ibm.com fixed description, added Fixes and Link] Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
1 parent a0b0987 commit 2f23256

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/s390/crypto/ap_bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ static int __verify_queue_reservations(struct device_driver *drv, void *data)
14351435
if (ap_drv->in_use) {
14361436
rc = ap_drv->in_use(ap_perms.apm, newaqm);
14371437
if (rc)
1438-
return -EBUSY;
1438+
rc = -EBUSY;
14391439
}
14401440

14411441
/* release the driver's module */

0 commit comments

Comments
 (0)