Skip to content

Commit

Permalink
MIPS: ralink: add missing put_device in ill_acc_of_setup
Browse files Browse the repository at this point in the history
If of_find_device_by_node return 0 and ill_acc_of_setup return error,
pdev don't have a corresponding object release.

Fix it by adding put_device.

Signed-off-by: yu kuai <yukuai3@huawei.com>
Signed-off-by: Paul Burton <paulburton@kernel.org>
Cc: <john@phrozen.org>
Cc: <ralf@linux-mips.org>
Cc: <jhogan@kernel.org>
Cc: <linux-mips@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>
Cc: <zhengbin13@huawei.com>
Cc: <yi.zhang@huawei.com>
  • Loading branch information
yu kuai authored and Paul Burton committed Jan 9, 2020
1 parent 9c48c48 commit defed0b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/mips/ralink/ill_acc.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ static int __init ill_acc_of_setup(void)
irq = irq_of_parse_and_map(np, 0);
if (!irq) {
dev_err(&pdev->dev, "failed to get irq\n");
put_device(&pdev->dev);
return -EINVAL;
}

if (request_irq(irq, ill_acc_irq_handler, 0, "ill_acc", &pdev->dev)) {
dev_err(&pdev->dev, "failed to request irq\n");
put_device(&pdev->dev);
return -EINVAL;
}

Expand Down

0 comments on commit defed0b

Please sign in to comment.