Skip to content

Commit

Permalink
EISA: Call put_device() if device_register() fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Levente Kurusa authored and Bjorn Helgaas committed Dec 13, 2013
1 parent 6ce4eac commit 04df008
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/eisa/eisa-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 04df008

Please sign in to comment.