aboutsummaryrefslogtreecommitdiffstats
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
committerJiri Kosina <jkosina@suse.cz>2018-04-26 14:36:43 +0200
commita4eb490a41a0da3b1275fc7427084cf9ae2c3c1c (patch)
treec4ecd66202bada3b4e55750239de610464eecb9c /drivers/hid/intel-ish-hid
parentHID: intel_ish-hid: Stop using a static local buffer in get_report() (diff)
downloadlinux-dev-a4eb490a41a0da3b1275fc7427084cf9ae2c3c1c.tar.xz
linux-dev-a4eb490a41a0da3b1275fc7427084cf9ae2c3c1c.zip
HID: intel-ish-hid: use put_device() instead of kfree()
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>
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;
}