Commit fc157998 authored by Christian Gromm's avatar Christian Gromm Committed by Greg Kroah-Hartman

staging: most: usb: check for NULL device

Check if the dci structer has been allocated before trying to release it.
Signed-off-by: default avatarChristian Gromm <christian.gromm@microchip.com>
Link: https://lore.kernel.org/r/1579793906-5054-8-git-send-email-christian.gromm@microchip.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f9e6b51a
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment