Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dmaengine: bcm-sba-raid: fix device leak on probe

Make sure to drop the reference taken when looking up the mailbox device
during probe on probe failures and on driver unbind.

Fixes: 743e1c8ffe4e ("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>

authored by

Johan Hovold and committed by
Vinod Koul
7c3a46eb b9074b2d

+5 -1
+5 -1
drivers/dma/bcm-sba-raid.c
··· 1699 1699 /* Prealloc channel resource */ 1700 1700 ret = sba_prealloc_channel_resources(sba); 1701 1701 if (ret) 1702 - goto fail_free_mchan; 1702 + goto fail_put_mbox; 1703 1703 1704 1704 /* Check availability of debugfs */ 1705 1705 if (!debugfs_initialized()) ··· 1729 1729 fail_free_resources: 1730 1730 debugfs_remove_recursive(sba->root); 1731 1731 sba_freeup_channel_resources(sba); 1732 + fail_put_mbox: 1733 + put_device(sba->mbox_dev); 1732 1734 fail_free_mchan: 1733 1735 mbox_free_channel(sba->mchan); 1734 1736 return ret; ··· 1745 1743 debugfs_remove_recursive(sba->root); 1746 1744 1747 1745 sba_freeup_channel_resources(sba); 1746 + 1747 + put_device(sba->mbox_dev); 1748 1748 1749 1749 mbox_free_channel(sba->mchan); 1750 1750 }