aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChristian Gromm2020-01-23 16:38:23 +0100
committerGreg Kroah-Hartman2020-01-24 10:08:41 +0100
commitfc157998b8257fb9cfe753e7f4af1411da995c9b (patch)
treea2dafc8fa03cccf3ea7ad009e83fa77302bc4c58 /drivers
parentf9e6b51a998da782cfc201dc9309d3a3d8579fef (diff)
staging: most: usb: check for NULL device
Check if the dci structer has been allocated before trying to release it. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Link: https://lore.kernel.org/r/1579793906-5054-8-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/most/usb/usb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/most/usb/usb.c b/drivers/staging/most/usb/usb.c
index dcc78cd870b8..0bda88c4bc89 100644
--- a/drivers/staging/most/usb/usb.c
+++ b/drivers/staging/most/usb/usb.c
@@ -1218,7 +1218,8 @@ static void hdm_disconnect(struct usb_interface *interface)
del_timer_sync(&mdev->link_stat_timer);
cancel_work_sync(&mdev->poll_work_obj);
- device_unregister(&mdev->dci->dev);
+ if (mdev->dci)
+ device_unregister(&mdev->dci->dev);
most_deregister_interface(&mdev->iface);
kfree(mdev->busy_urbs);