Hi, On Mon, Nov 20, 2023 at 11:33 AM Hans de Goede <hdegoede@xxxxxxxxxx> wrote: > > @@ -741,12 +741,9 @@ static int i2c_hid_parse(struct hid_device *hid) > return -EINVAL; > } > > + mutex_lock(&ihid->reset_lock); > do { > - mutex_lock(&ihid->reset_lock); > ret = i2c_hid_start_hwreset(ihid); > - if (ret == 0) > - ret = i2c_hid_finish_hwreset(ihid); > - mutex_unlock(&ihid->reset_lock); > if (ret) > msleep(1000); > } while (tries-- > 0 && ret); Right after this loop, you have: if (ret) return ret; That will return with the mutex held. It needs to be a "goto abort_reset". You'd also need to init `use_override` then, I think. I'll also note that it seems awkward that `clear_bit(I2C_HID_RESET_PENDING, &ihid->flags)` is scattered in so many places for error handling, but I couldn't really find a better way to do it. :-P -Doug