Skip to content

Commit 78bd03e

Browse files
LorenzoBianconikuba-moo
authored andcommitted
net: airoha: Always check return value from airoha_ppe_foe_get_entry()
airoha_ppe_foe_get_entry routine can return NULL, so check the returned pointer is not NULL in airoha_ppe_foe_flow_l2_entry_update() Fixes: b81e0f2 ("net: airoha: Add FLOW_CLS_STATS callback support") Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Link: https://patch.msgid.link/20250618-check-ret-from-airoha_ppe_foe_get_entry-v2-1-068dcea3cc66@kernel.org Signed-off-by: Jakub Kicinski <[email protected]>
1 parent fc27ab4 commit 78bd03e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ethernet/airoha/airoha_ppe.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,8 +809,10 @@ airoha_ppe_foe_flow_l2_entry_update(struct airoha_ppe *ppe,
809809
int idle;
810810

811811
hwe = airoha_ppe_foe_get_entry(ppe, iter->hash);
812-
ib1 = READ_ONCE(hwe->ib1);
812+
if (!hwe)
813+
continue;
813814

815+
ib1 = READ_ONCE(hwe->ib1);
814816
state = FIELD_GET(AIROHA_FOE_IB1_BIND_STATE, ib1);
815817
if (state != AIROHA_FOE_STATE_BIND) {
816818
iter->hash = 0xffff;

0 commit comments

Comments
 (0)