lkml.org 
[lkml]   [2013]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 19/38] net: atm: add missing put_device call
From
From: Levente Kurusa <levex@linux.com>
Date: Thu, 19 Dec 2013 16:03:30 +0100

> This is required so that we give up the last reference to the device.
>
> Signed-off-by: Levente Kurusa <levex@linux.com>
...
> @@ -154,8 +154,10 @@ int atm_register_sysfs(struct atm_dev *adev, struct device *parent)
>
> dev_set_name(cdev, "%s%d", adev->type, adev->number);
> err = device_register(cdev);
> - if (err < 0)
> + if (err < 0) {
> + put_device(cdev);
> return err;
> + }

This doesn't make any sense.

Nothing has a reference to 'cdev'. Yes, 'adev' has a reference,
acquired by the caller of this function, but that's not what we're
working with here.


\
 
 \ /
  Last update: 2013-12-27 19:21    [W:1.152 / U:1.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site