Commit ff8a43c1 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: keyspan: fix null-deref at disconnect and release

Make sure to fail properly if the device is not accepted during attach
in order to avoid null-pointer derefs (of missing interface private
data) at disconnect or release.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ef6c8c1d
...@@ -2303,7 +2303,7 @@ static int keyspan_startup(struct usb_serial *serial) ...@@ -2303,7 +2303,7 @@ static int keyspan_startup(struct usb_serial *serial)
if (d_details == NULL) { if (d_details == NULL) {
dev_err(&serial->dev->dev, "%s - unknown product id %x\n", dev_err(&serial->dev->dev, "%s - unknown product id %x\n",
__func__, le16_to_cpu(serial->dev->descriptor.idProduct)); __func__, le16_to_cpu(serial->dev->descriptor.idProduct));
return 1; return -ENODEV;
} }
/* Setup private data for serial driver */ /* Setup private data for serial driver */
......
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