Message ID | B31757FE8E1544CF+20241125052616.18261-1-wangyuli@uniontech.com (mailing list archive) |
---|---|
State | New |
Delegated to: | Jiri Kosina |
Headers | show |
Series | HID: wacom: fix when get product name maybe null pointer | expand |
On Mon, 25 Nov 2024 13:26:16 +0800, WangYuli wrote: > Due to incorrect dev->product reporting by certain devices, null > pointer dereferences occur when dev->product is empty, leading to > potential system crashes. > > This issue was found on EXCELSIOR DL37-D05 device with > Loongson-LS3A6000-7A2000-DL37 motherboard. > > [...] Applied to hid/hid.git (for-6.13/upstream-fixes), thanks! [1/1] HID: wacom: fix when get product name maybe null pointer https://git.kernel.org/hid/hid/c/59548215b76b Cheers,
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 2bc45b24075c..9843b52bd017 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -2241,7 +2241,8 @@ static void wacom_update_name(struct wacom *wacom, const char *suffix) if (hid_is_usb(wacom->hdev)) { struct usb_interface *intf = to_usb_interface(wacom->hdev->dev.parent); struct usb_device *dev = interface_to_usbdev(intf); - product_name = dev->product; + if (dev->product != NULL) + product_name = dev->product; } if (wacom->hdev->bus == BUS_I2C) {