summaryrefslogtreecommitdiff
path: root/drivers/hid/intel-ish-hid
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2018-03-30 16:56:10 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-06-21 04:02:48 +0900
commit11ac08bd73ebfda3bb0c7b748d0306bdb658e6fe (patch)
treeafd57169386c08bee24afb18b4b9a3cf97e24f4f /drivers/hid/intel-ish-hid
parentd803d94a3fcde7f317c40cc846d7c585532119f0 (diff)
HID: intel-ish-hid: use put_device() instead of kfree()
[ Upstream commit a4eb490a41a0da3b1275fc7427084cf9ae2c3c1c ] Never directly free @dev after calling device_register(), even if it returned an error. Always use put_device() to give up the reference initialized. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hid/intel-ish-hid')
-rw-r--r--drivers/hid/intel-ish-hid/ishtp/bus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c
index f272cdd9bd55..2623a567ffba 100644
--- a/drivers/hid/intel-ish-hid/ishtp/bus.c
+++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
@@ -418,7 +418,7 @@ static struct ishtp_cl_device *ishtp_bus_add_device(struct ishtp_device *dev,
list_del(&device->device_link);
spin_unlock_irqrestore(&dev->device_list_lock, flags);
dev_err(dev->devc, "Failed to register ISHTP client device\n");
- kfree(device);
+ put_device(&device->dev);
return NULL;
}