Skip to content

Commit

Permalink
misc: rtsx: set NULL intfdata when probe fails
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
shuahkh authored and gregkh committed May 9, 2022
1 parent 9145554 commit f861d36
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/misc/cardreader/rtsx_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f861d36

Please sign in to comment.