Commit 78bd03ee authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Jakub Kicinski
Browse files

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: b81e0f2b ("net: airoha: Add FLOW_CLS_STATS callback support")
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20250618-check-ret-from-airoha_ppe_foe_get_entry-v2-1-068dcea3cc66@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent fc27ab48
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -809,8 +809,10 @@ airoha_ppe_foe_flow_l2_entry_update(struct airoha_ppe *ppe,
		int idle;

		hwe = airoha_ppe_foe_get_entry(ppe, iter->hash);
		ib1 = READ_ONCE(hwe->ib1);
		if (!hwe)
			continue;

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