diff options
| author | Markus Elfring <elfring@users.sourceforge.net> | 2015-02-05 11:48:26 +0100 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-11 10:58:23 +0200 |
| commit | 71221ff54ab2e8d537f464f3061013e03fb9b472 (patch) | |
| tree | e6bd7a6cf0184226252cb05250096414d731e835 /drivers | |
| parent | c55811e46bff749df87b204f45235bad3d1aff23 (diff) | |
driver core: Delete an unnecessary check before the function call "put_device"
commit 5f0163a5ee9cc7c59751768bdfd94a73186debba upstream.
The put_device() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[wt: backported only to ease next patch as suggested by Jiri]
Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/base/core.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index 2a19097a7..d92ecf393 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -1138,8 +1138,7 @@ done: kobject_del(&dev->kobj); Error: cleanup_device_parent(dev); - if (parent) - put_device(parent); + put_device(parent); name_error: kfree(dev->p); dev->p = NULL; |
