Skip to content

Commit 2ed1a9d

Browse files
jhovoldgregkh
authored andcommitted
dmaengine: bcm-sba-raid: fix device leak on probe
commit 7c3a46ebf15a9796b763a54272407fdbf945bed8 upstream. Make sure to drop the reference taken when looking up the mailbox device during probe on probe failures and on driver unbind. Fixes: 743e1c8 ("dmaengine: Add Broadcom SBA RAID driver") Cc: stable@vger.kernel.org # 4.13 Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20251117161258.10679-4-johan@kernel.org Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f3c23b7 commit 2ed1a9d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

drivers/dma/bcm-sba-raid.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1699,7 +1699,7 @@ static int sba_probe(struct platform_device *pdev)
16991699
/* Prealloc channel resource */
17001700
ret = sba_prealloc_channel_resources(sba);
17011701
if (ret)
1702-
goto fail_free_mchan;
1702+
goto fail_put_mbox;
17031703

17041704
/* Check availability of debugfs */
17051705
if (!debugfs_initialized())
@@ -1729,6 +1729,8 @@ static int sba_probe(struct platform_device *pdev)
17291729
fail_free_resources:
17301730
debugfs_remove_recursive(sba->root);
17311731
sba_freeup_channel_resources(sba);
1732+
fail_put_mbox:
1733+
put_device(sba->mbox_dev);
17321734
fail_free_mchan:
17331735
mbox_free_channel(sba->mchan);
17341736
return ret;
@@ -1744,6 +1746,8 @@ static void sba_remove(struct platform_device *pdev)
17441746

17451747
sba_freeup_channel_resources(sba);
17461748

1749+
put_device(sba->mbox_dev);
1750+
17471751
mbox_free_channel(sba->mchan);
17481752
}
17491753

0 commit comments

Comments
 (0)