Skip to content

Commit 04df008

Browse files
levexbjorn-helgaas
authored andcommitted
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>
1 parent 6ce4eac commit 04df008

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎drivers/eisa/eisa-bus.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,10 @@ static int __init eisa_init_device(struct eisa_root_device *root,
232232
static int __init eisa_register_device(struct eisa_device *edev)
233233
{
234234
int rc = device_register(&edev->dev);
235-
if (rc)
235+
if (rc) {
236+
put_device(&edev->dev);
236237
return rc;
238+
}
237239

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

0 commit comments

Comments
 (0)