Re: [PATCH v3] HID: logitech-dj: Fix mouse detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Thank you for tracking down the cause of this and for
providing an initial patch fixing this.

On 25-07-19 16:19, Lionel Landwerlin wrote:
Now logi_dj_recv_query_paired_devices() will return a positive value
while success, but logi_dj_probe expect zero in case of success, so
set it to 0 before return.

Fixes this error :

    logitech-djreceiver: probe of 0003:046D:C534.0006 failed with error 7

Also prevents the pluging of the mouse dongle in/out to hang the
system.

v2: Drop useless retval = 0 (YueHaibing)

v3: Add explanation (YueHaibing)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@xxxxxxxxx>
Cc: linux-input@xxxxxxxxxxxxxxx
Cc: yuehaibing@xxxxxxxxxx
Cc: hdegoede@xxxxxxxxxx
Cc: benjamin.tissoires@xxxxxxxxxx
Fixes: dbcbabf7da92 ("HID: logitech-dj: fix return value of logi_dj_recv_query_hidpp_devices")
Reviewed-by: YueHaibing <yuehaibing@xxxxxxxxxx>
---
  drivers/hid/hid-logitech-dj.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
index 6196217a7d93..8cdf37309ada 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
@@ -1736,6 +1736,7 @@ static int logi_dj_probe(struct hid_device *hdev,
  				__func__, retval);
  			goto logi_dj_recv_query_paired_devices_failed;
  		}
+		retval = 0;
  	}
return retval;

You are now overriding the return value with 0, even if it is an error,
effectively undoing the result of commit dbcbabf7da92, except that an
error will no be logged (but other then the logging nothing will change).

I've just hit the issue caused by this myself after upgrading to 5.3-rc2
myself. I've prepared a fix which properly fixes this by making
logi_dj_recv_query_hidpp_device either return the negative error returned
by hid_hw_raw_request or 0 when hid_hw_raw_request succeeded.

I will put you in the Cc of the patch fixing for this.

Regards,

Hans



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux