summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
diff options
context:
space:
mode:
authorSathya Perla <sathya.perla@broadcom.com>2017-08-28 13:40:32 -0400
committerDavid S. Miller <davem@davemloft.net>2017-08-28 16:57:10 -0700
commit70855603e0a129d1c810947a4e4dd7ecd6f4560d (patch)
treea29c77bbb76ed7408e90586aa3083ae95e70557e /drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
parentd5430d31ca72ec37fd539fd1c5230859509be4ef (diff)
downloadlinux-70855603e0a129d1c810947a4e4dd7ecd6f4560d.tar.bz2
bnxt_en: fix clearing devlink ptr from bnxt struct
The routine bnxt_link_bp_to_dl() is used to set the devlink ptr in bnxt struct (bp) and also to set the bnxt back ptr in the devlink struct. If devlink_register() fails, bp->dl must be cleared which is not happening currently. This patch fixes bnxt_link_bp_to_dl() to clear bp->dl by passing a NULL dl ptr. Fixes: 4ab0c6a8ffd7 ("bnxt_en: add support to enable VF-representors") Signed-off-by: Sathya Perla <sathya.perla@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
index 86cce6f53f78..c365d3cf8e51 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
@@ -468,11 +468,11 @@ int bnxt_dl_register(struct bnxt *bp)
return -ENOMEM;
}
- bnxt_link_bp_to_dl(dl, bp);
+ bnxt_link_bp_to_dl(bp, dl);
bp->eswitch_mode = DEVLINK_ESWITCH_MODE_LEGACY;
rc = devlink_register(dl, &bp->pdev->dev);
if (rc) {
- bnxt_link_bp_to_dl(dl, NULL);
+ bnxt_link_bp_to_dl(bp, NULL);
devlink_free(dl);
netdev_warn(bp->dev, "devlink_register failed. rc=%d", rc);
return rc;