staging: frontier: use after free in disconnect()
usb_alphatrack_delete() frees "dev" so we can't use it on that path. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
4b18f08be0
Коммит
c8145c5610
|
@ -827,11 +827,11 @@ static void usb_alphatrack_disconnect(struct usb_interface *intf)
|
||||||
mutex_unlock(&dev->mtx);
|
mutex_unlock(&dev->mtx);
|
||||||
usb_alphatrack_delete(dev);
|
usb_alphatrack_delete(dev);
|
||||||
} else {
|
} else {
|
||||||
|
atomic_set(&dev->writes_pending, 0);
|
||||||
dev->intf = NULL;
|
dev->intf = NULL;
|
||||||
mutex_unlock(&dev->mtx);
|
mutex_unlock(&dev->mtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
atomic_set(&dev->writes_pending, 0);
|
|
||||||
mutex_unlock(&disconnect_mutex);
|
mutex_unlock(&disconnect_mutex);
|
||||||
|
|
||||||
dev_info(&intf->dev, "Alphatrack Surface #%d now disconnected\n",
|
dev_info(&intf->dev, "Alphatrack Surface #%d now disconnected\n",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче