Commit 04df008a authored by Levente Kurusa's avatar Levente Kurusa Committed by Bjorn Helgaas

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: default avatarLevente Kurusa <levex@linux.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 6ce4eac1
...@@ -232,8 +232,10 @@ static int __init eisa_init_device(struct eisa_root_device *root, ...@@ -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) static int __init eisa_register_device(struct eisa_device *edev)
{ {
int rc = device_register(&edev->dev); int rc = device_register(&edev->dev);
if (rc) if (rc) {
put_device(&edev->dev);
return rc; return rc;
}
rc = device_create_file(&edev->dev, &dev_attr_signature); rc = device_create_file(&edev->dev, &dev_attr_signature);
if (rc) if (rc)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment