Skip to content

Commit

Permalink
r8152: Run the unload routine if we have errors during probe
Browse files Browse the repository at this point in the history
[ Upstream commit 5dd1768 ]

The rtl8152_probe() function lacks a call to the chip-specific
unload() routine when it sees an error in probe. Add it in to match
the cleanup code in rtl8152_disconnect().

Fixes: ac718b6 ("net/usb: new driver for RTL8152")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
dianders authored and gregkh committed Nov 2, 2023
1 parent 90b49a2 commit 56e8946
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/usb/r8152.c
Original file line number Diff line number Diff line change
Expand Up @@ -9802,6 +9802,8 @@ static int rtl8152_probe(struct usb_interface *intf,

out1:
tasklet_kill(&tp->tx_tl);
if (tp->rtl_ops.unload)
tp->rtl_ops.unload(tp);
usb_set_intfdata(intf, NULL);
out:
free_netdev(netdev);
Expand Down

0 comments on commit 56e8946

Please sign in to comment.