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>
This commit is contained in:
parent
d803d94a3f
commit
11ac08bd73
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user