Skip to content

Commit

Permalink
staging: frontier: use after free in disconnect()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Jul 23, 2013
1 parent 4b18f08 commit c8145c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/frontier/alphatrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,11 +827,11 @@ static void usb_alphatrack_disconnect(struct usb_interface *intf)
mutex_unlock(&dev->mtx);
usb_alphatrack_delete(dev);
} else {
atomic_set(&dev->writes_pending, 0);
dev->intf = NULL;
mutex_unlock(&dev->mtx);
}

atomic_set(&dev->writes_pending, 0);
mutex_unlock(&disconnect_mutex);

dev_info(&intf->dev, "Alphatrack Surface #%d now disconnected\n",
Expand Down

0 comments on commit c8145c5

Please sign in to comment.