Patch "octeontx2-af: Check return value of nix_get_nixlf before using nixlf" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    octeontx2-af: Check return value of nix_get_nixlf before using nixlf

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     octeontx2-af-check-return-value-of-nix_get_nixlf-bef.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b2d15b718f08c40a483b1c6510141379ec7988e4
Author: Subbaraya Sundeep <sbhatta@xxxxxxxxxxx>
Date:   Wed Nov 29 11:11:48 2023 +0530

    octeontx2-af: Check return value of nix_get_nixlf before using nixlf
    
    [ Upstream commit 830139e7b6911266a84a77e1f18abf758995cc89 ]
    
    If a NIXLF is not attached to a PF/VF device then
    nix_get_nixlf function fails and returns proper error
    code. But npc_get_default_entry_action does not check it
    and uses garbage value in subsequent calls. Fix this
    by cheking the return value of nix_get_nixlf.
    
    Fixes: 967db3529eca ("octeontx2-af: add support for multicast/promisc packet replication feature")
    Signed-off-by: Subbaraya Sundeep <sbhatta@xxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
index 16cfc802e348d..f65805860c8d4 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
@@ -389,7 +389,13 @@ static u64 npc_get_default_entry_action(struct rvu *rvu, struct npc_mcam *mcam,
 	int bank, nixlf, index;
 
 	/* get ucast entry rule entry index */
-	nix_get_nixlf(rvu, pf_func, &nixlf, NULL);
+	if (nix_get_nixlf(rvu, pf_func, &nixlf, NULL)) {
+		dev_err(rvu->dev, "%s: nixlf not attached to pcifunc:0x%x\n",
+			__func__, pf_func);
+		/* Action 0 is drop */
+		return 0;
+	}
+
 	index = npc_get_nixlf_mcam_index(mcam, pf_func, nixlf,
 					 NIXLF_UCAST_ENTRY);
 	bank = npc_get_bank(mcam, index);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux