summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorShuah Khan <skhan@linuxfoundation.org>2022-04-29 15:09:13 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-14 18:12:00 +0200
commitfa0b2dd6829dcd27f4eeacaeef4275b12967a52e (patch)
treecc08831940e8c7d4bc4c39baa37480cd38b249b3 /drivers/misc
parentd232ca0bbc7d03144bad0ffd1792c3352bfd03fa (diff)
downloadlinux-stable-fa0b2dd6829dcd27f4eeacaeef4275b12967a52e.tar.gz
linux-stable-fa0b2dd6829dcd27f4eeacaeef4275b12967a52e.tar.bz2
linux-stable-fa0b2dd6829dcd27f4eeacaeef4275b12967a52e.zip
misc: rtsx: set NULL intfdata when probe fails
[ Upstream commit f861d36e021e1ac4a0a2a1f6411d623809975d63 ] 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). Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Link: https://lore.kernel.org/r/20220429210913.46804-1-skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/cardreader/rtsx_usb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/misc/cardreader/rtsx_usb.c b/drivers/misc/cardreader/rtsx_usb.c
index a328cab11014..4aef33d07cc3 100644
--- a/drivers/misc/cardreader/rtsx_usb.c
+++ b/drivers/misc/cardreader/rtsx_usb.c
@@ -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;