From: lanshh Date: Mon, 14 Nov 2016 01:50:57 +0000 (+0800) Subject: hid: rkvr: fix inconsistent returns in inv_hid_register_devcie() X-Git-Tag: firefly_0821_release~1274 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1ab12e3f7ce0835a8f9b94e15f4972fbfedb1953;p=firefly-linux-kernel-4.4.55.git hid: rkvr: fix inconsistent returns in inv_hid_register_devcie() Change-Id: Ida0a3dff53c9e47dc04b0111ea56500d1adcbb3c Signed-off-by: lanshh --- diff --git a/drivers/hid/hid-rkvr.c b/drivers/hid/hid-rkvr.c index 4360c28dd729..0bdafb380a5f 100644 --- a/drivers/hid/hid-rkvr.c +++ b/drivers/hid/hid-rkvr.c @@ -142,6 +142,7 @@ static int inv_hid_register_devcie(struct rkvr_iio_hw_device *hw_device) list_for_each_entry(p, &rkvr_hid_hw_device_list, l) { if (!strcmp(hw_device->name, p->name)) { pr_err("%s already exist ,abort\n", hw_device->name); + mutex_unlock(&device_list_lock); return -1; } }