The USB protocol allows devices to have multiple "configurations" that the OS can switch between. A an "unconfigured" state is also possible, especially when the device is first connected. If '__wacom_is_usb_parent' comes across an unconfigured USB device, the 'config' variable will be NULL. We need to add a check for this state before attempting a dereference.
Signed-off-by: Jason Gerecke <jason.gere...@wacom.com> --- 4.5/wacom_sys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/4.5/wacom_sys.c b/4.5/wacom_sys.c index cfe5fa8..3a65174 100644 --- a/4.5/wacom_sys.c +++ b/4.5/wacom_sys.c @@ -30,7 +30,7 @@ static int __wacom_is_usb_parent(struct usb_device *usbdev, void *ptr) struct usb_host_config *config = usbdev->actconfig; int i; - for (i = 0; i < config->desc.bNumInterfaces; i++) { + for (i = 0; config && i < config->desc.bNumInterfaces; i++) { if (&config->interface[i]->dev == parent) return 1; } -- 2.13.4 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel