mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-30 10:49:28 +00:00
mt76: usb: fix possible NULL pointer dereference in mt76u_mcu_deinit
Fix possible NULL pointer dereference in mt76u_mcu_deinit routine that
can occur if initialization path fails before calling mt76u_mcu_init_rx
Fixes: ee676cd501
("mt76: add driver code for MT76x2u based devices")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
5de4db8fcb
commit
bdba48d57a
1 changed files with 5 additions and 3 deletions
|
@ -48,9 +48,11 @@ EXPORT_SYMBOL_GPL(mt76u_mcu_init_rx);
|
|||
|
||||
void mt76u_mcu_deinit(struct mt76_dev *dev)
|
||||
{
|
||||
struct mt76_usb *usb = &dev->usb;
|
||||
struct mt76u_buf *buf = &dev->usb.mcu.res;
|
||||
|
||||
usb_kill_urb(usb->mcu.res.urb);
|
||||
mt76u_buf_free(&usb->mcu.res);
|
||||
if (buf->urb) {
|
||||
usb_kill_urb(buf->urb);
|
||||
mt76u_buf_free(buf);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76u_mcu_deinit);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue