HID:hid-magicmouse:Fix repeated initialization
PATCH 1/1 HID:hid-magicmouse:Fix repeated initialization
If the first report returns NULL,
there is no need to execute thehid_register_report function a
second time.
Signed-off-by Wang Ming <[email protected]>
--- drivers/hid/hid-magicmouse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/hid/hid-magicmouse.c +4 -2
@@ -857,8 +857,10 @@ static int magicmouse_probe(struct hid_device *hdev, }else {/* USB_DEVICE_ID_APPLE_MAGICTRACKPAD */ report =hid_register_report (hdev,HID_INPUT_REPORT ,TRACKPAD_REPORT_ID ,0 ); - report =hid_register_report (hdev,HID_INPUT_REPORT , -DOUBLE_REPORT_ID ,0 ); +if (report) { + report =hid_register_report (hdev,HID_INPUT_REPORT , +DOUBLE_REPORT_ID ,0 ); + } }if (!report) {
Signature · 1 line
2.25.1