lkml.org 
[lkml]   [2013]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/4] eisa: call put_device if device_register fails
Date
We need to give up the last reference to edev->dev, so
we need to call put_device().

Cc: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Levente Kurusa <levex@linux.com>
---
drivers/eisa/eisa-bus.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c
index 272a3ec..8842cde 100644
--- a/drivers/eisa/eisa-bus.c
+++ b/drivers/eisa/eisa-bus.c
@@ -232,8 +232,10 @@ static int __init eisa_init_device(struct eisa_root_device *root,
static int __init eisa_register_device(struct eisa_device *edev)
{
int rc = device_register(&edev->dev);
- if (rc)
+ if (rc) {
+ put_device(&edev->dev);
return rc;
+ }

rc = device_create_file(&edev->dev, &dev_attr_signature);
if (rc)
--
1.8.3.1


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