Forwarded: [PATCH] mmc: vub300: fix sleeping function call from invalid context in vub300_inactivity_timer_expired

syzbot posted 1 patch 1 month, 1 week ago
drivers/mmc/host/vub300.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Forwarded: [PATCH] mmc: vub300: fix sleeping function call from invalid context in vub300_inactivity_timer_expired
Posted by syzbot 1 month, 1 week ago
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: [PATCH] mmc: vub300: fix sleeping function call from invalid context in vub300_inactivity_timer_expired
Author: jakovnovak30@gmail.com

#syz test

---
 drivers/mmc/host/vub300.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c
index 2dae474dcd06..fee74c6ab720 100644
--- a/drivers/mmc/host/vub300.c
+++ b/drivers/mmc/host/vub300.c
@@ -744,7 +744,8 @@ static void vub300_inactivity_timer_expired(struct timer_list *t)
 	struct vub300_mmc_host *vub300 = timer_container_of(vub300, t,
 							    inactivity_timer);
 	if (!vub300->interface) {
-		kref_put(&vub300->kref, vub300_delete);
+		//kref_put(&vub300->kref, vub300_delete);
+		vub300_queue_dead_work(vub300);
 	} else if (vub300->cmd) {
 		mod_timer(&vub300->inactivity_timer, jiffies + HZ);
 	} else {
-- 
2.55.0