lkml.org 
[lkml]   [2018]   [Jun]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 068/189] HID: intel-ish-hid: use put_device() instead of kfree()
    Date
    4.14-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Arvind Yadav <arvind.yadav.cs@gmail.com>

    [ 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>
    ---
    drivers/hid/intel-ish-hid/ishtp/bus.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- 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
    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;
    }


    \
     
     \ /
      Last update: 2018-06-18 11:05    [W:2.430 / U:0.320 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site