Skip to contentSkip to conversation

misc: rtsx: set NULL intfdata when probe fails

PATCH New Shuah Khan 1 participant 1 message Apr 29, 2022 Char and misc drivers

lore
Share & tools
lore

Shuah Khan

author
#0 lore raw

PATCH 1/1 misc: rtsx: set NULL intfdata when probe fails

rtsx_usb_probe() doesn't call usb_set_intfdata() to null out the interface pointer when probe fails. This leaves a stale pointer. Noticed the missing usb_set_intfdata() while debugging an unrelated invalid DMA mapping problem.

Fix it with a call to usb_set_intfdata(..., NULL).

---
 drivers/misc/cardreader/rtsx_usb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/misc/cardreader/rtsx_usb.c +1 -0
index 59eda55d92a3..1ef9b61077c4 100644
@@ -667,6 +667,7 @@ static int rtsx_usb_probe(struct usb_interface *intf,
 	return 0;
 
 out_init_fail:
+	usb_set_intfdata(ucr->pusb_intf, NULL);
 	usb_free_coherent(ucr->pusb_dev, IOBUF_SIZE, ucr->iobuf,
 			ucr->iobuf_dma);
 	return ret;
Signature · 1 line
2.32.0