Skip to contentSkip to conversation

USB: misc: uss720: Fix leak in get_1284_register

PATCH New Michail Tatas 1 participant 1 message Jul 16 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: misc: uss720: Fix leak in get_1284_register

if wait_for_completion_timeout() times out in get_1284_register() then we do not destroy the reference acquired via kref_get() in submit_async_request. Add the missing kref_put in the timeout path.

---
 drivers/usb/misc/uss720.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/misc/uss720.c +1 -0
index 1ce48f5832d7..bd0ad7c3261d 100644
@@ -223,6 +223,7 @@ static int get_1284_register(struct parport *pp, unsigned char reg, unsigned cha
 	}
 	printk(KERN_WARNING "get_1284_register timeout\n");
 	kill_all_async_requests_priv(priv);
+	kref_put(&rq->ref_count, destroy_async);
 	return -EIO;
 }
 
Signature · 1 line
2.43.0