diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2018-03-30 14:26:10 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-06-20 22:02:48 +0300 |
commit | 11ac08bd73ebfda3bb0c7b748d0306bdb658e6fe (patch) | |
tree | afd57169386c08bee24afb18b4b9a3cf97e24f4f /drivers/hid | |
parent | d803d94a3fcde7f317c40cc846d7c585532119f0 (diff) | |
download | linux-11ac08bd73ebfda3bb0c7b748d0306bdb658e6fe.tar.xz |
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')
-rw-r--r-- | drivers/hid/intel-ish-hid/ishtp/bus.c | 2 |
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; } |