diff options
author | Salil Mehta <salil.mehta@huawei.com> | 2019-02-18 17:40:32 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-06-03 08:16:48 +0200 |
commit | bd756613f02baa088d2ebb476b40c1334ef97cf6 (patch) | |
tree | ef5988c46b1354caf4fbe460fcfb7e118f129690 | |
parent | d5375ed938b7e85b443894f9e7090ec7e803d0cd (diff) | |
download | linux-stable-bd756613f02baa088d2ebb476b40c1334ef97cf6.tar.gz linux-stable-bd756613f02baa088d2ebb476b40c1334ef97cf6.tar.bz2 linux-stable-bd756613f02baa088d2ebb476b40c1334ef97cf6.zip |
net: hns: Fixes the missing put_device in positive leg for roce reset
commit 4d96e13ee9cd1f7f801e8c7f4b12f09d1da4a5d8 upstream.
This patch fixes the missing device reference release-after-use in
the positive leg of the roce reset API of the HNS DSAF.
Fixes: c969c6e7ab8c ("net: hns: Fix object reference leaks in hns_dsaf_roce_reset()")
Reported-by: John Garry <john.garry@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c index 551b2a9ebf0f..4a4e86000192 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c @@ -2867,6 +2867,9 @@ int hns_dsaf_roce_reset(struct fwnode_handle *dsaf_fwnode, bool dereset) dsaf_set_bit(credit, DSAF_SBM_ROCEE_CFG_CRD_EN_B, 1); dsaf_write_dev(dsaf_dev, DSAF_SBM_ROCEE_CFG_REG_REG, credit); } + + put_device(&pdev->dev); + return 0; } EXPORT_SYMBOL(hns_dsaf_roce_reset); |