]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
misc: rtsx: set NULL intfdata when probe fails
authorShuah Khan <skhan@linuxfoundation.org>
Fri, 29 Apr 2022 21:09:13 +0000 (15:09 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 14:52:40 +0000 (16:52 +0200)
[ 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>
drivers/mfd/rtsx_usb.c

index 691dab791f7af81d91ed3892a945c74c1f0d3fa1..e94f855eac15549bf24f08a20902b6f05ab1dff5 100644 (file)
@@ -678,6 +678,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;