Skip to content

Commit a9682bf

Browse files
nifeygregkh
authored andcommitted
wifi: at76c50x: fix use after free access in at76_disconnect
[ Upstream commit 27c7e63 ] The memory pointed to by priv is freed at the end of at76_delete_device function (using ieee80211_free_hw). But the code then accesses the udev field of the freed object to put the USB device. This may also lead to a memory leak of the usb device. Fix this by using udev from interface. Fixes: 29e20aa ("at76c50x-usb: fix use after free on failure path in at76_probe()") Signed-off-by: Abdun Nihaal <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 1773fbf commit a9682bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/wireless/atmel/at76c50x-usb.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2552,7 +2552,7 @@ static void at76_disconnect(struct usb_interface *interface)
25522552

25532553
wiphy_info(priv->hw->wiphy, "disconnecting\n");
25542554
at76_delete_device(priv);
2555-
usb_put_dev(priv->udev);
2555+
usb_put_dev(interface_to_usbdev(interface));
25562556
dev_info(&interface->dev, "disconnected\n");
25572557
}
25582558

0 commit comments

Comments
 (0)