diff options
author | Levente Kurusa <levex@linux.com> | 2013-12-13 18:39:54 (GMT) |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-12-13 19:00:42 (GMT) |
commit | 04df008afe0c569fd09400a35b7d3db29067114c (patch) | |
tree | 19053ca6c50a060c7bed4abf3b91e1c6e169ee8d /drivers/eisa/eisa-bus.c | |
parent | 6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae (diff) | |
download | linux-04df008afe0c569fd09400a35b7d3db29067114c.tar.xz |
EISA: Call put_device() if device_register() fails
We need to give up the last reference to edev->dev, so we need to call
put_device().
Signed-off-by: Levente Kurusa <levex@linux.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/eisa/eisa-bus.c')
-rw-r--r-- | drivers/eisa/eisa-bus.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) |