* [PATCH net-next] net: airoha: Always check return value from airoha_ppe_foe_get_entry()
@ 2025-06-16 10:27 Lorenzo Bianconi
2025-06-16 16:43 ` Simon Horman
2025-06-17 22:31 ` Jakub Kicinski
0 siblings, 2 replies; 4+ messages in thread
From: Lorenzo Bianconi @ 2025-06-16 10:27 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman
Cc: linux-arm-kernel, linux-mediatek, netdev, Lorenzo Bianconi
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: b81e0f2b58be3 ("net: airoha: Add FLOW_CLS_STATS callback support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/ethernet/airoha/airoha_ppe.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/airoha/airoha_ppe.c b/drivers/net/ethernet/airoha/airoha_ppe.c
index 50d816344b1f8c1ed639de357f62e761ede92f05..c354d536bc66e97ab853792e4ab4273283d2fb91 100644
--- a/drivers/net/ethernet/airoha/airoha_ppe.c
+++ b/drivers/net/ethernet/airoha/airoha_ppe.c
@@ -819,8 +819,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;
---
base-commit: 8909f5f4ecd551c2299b28e05254b77424c8c7dc
change-id: 20250616-check-ret-from-airoha_ppe_foe_get_entry-285677102dfa
Best regards,
--
Lorenzo Bianconi <lorenzo@kernel.org>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: airoha: Always check return value from airoha_ppe_foe_get_entry()
2025-06-16 10:27 [PATCH net-next] net: airoha: Always check return value from airoha_ppe_foe_get_entry() Lorenzo Bianconi
@ 2025-06-16 16:43 ` Simon Horman
2025-06-17 22:31 ` Jakub Kicinski
1 sibling, 0 replies; 4+ messages in thread
From: Simon Horman @ 2025-06-16 16:43 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, linux-arm-kernel, linux-mediatek, netdev
On Mon, Jun 16, 2025 at 12:27:06PM +0200, Lorenzo Bianconi wrote:
> 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: b81e0f2b58be3 ("net: airoha: Add FLOW_CLS_STATS callback support")
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: airoha: Always check return value from airoha_ppe_foe_get_entry()
2025-06-16 10:27 [PATCH net-next] net: airoha: Always check return value from airoha_ppe_foe_get_entry() Lorenzo Bianconi
2025-06-16 16:43 ` Simon Horman
@ 2025-06-17 22:31 ` Jakub Kicinski
2025-06-18 7:39 ` Lorenzo Bianconi
1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2025-06-17 22:31 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
Simon Horman, linux-arm-kernel, linux-mediatek, netdev
On Mon, 16 Jun 2025 12:27:06 +0200 Lorenzo Bianconi wrote:
> Subject: [PATCH net-next] 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: b81e0f2b58be3 ("net: airoha: Add FLOW_CLS_STATS callback support")
Looks like the commit under fixes is in net, is the tree in the subject
wrong?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: airoha: Always check return value from airoha_ppe_foe_get_entry()
2025-06-17 22:31 ` Jakub Kicinski
@ 2025-06-18 7:39 ` Lorenzo Bianconi
0 siblings, 0 replies; 4+ messages in thread
From: Lorenzo Bianconi @ 2025-06-18 7:39 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
Simon Horman, linux-arm-kernel, linux-mediatek, netdev
[-- Attachment #1: Type: text/plain, Size: 557 bytes --]
> On Mon, 16 Jun 2025 12:27:06 +0200 Lorenzo Bianconi wrote:
> > Subject: [PATCH net-next] 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: b81e0f2b58be3 ("net: airoha: Add FLOW_CLS_STATS callback support")
>
> Looks like the commit under fixes is in net, is the tree in the subject
> wrong?
ack, fine. I will post v2 targeting net tree.
Regards,
Lorenzo
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-06-18 7:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-16 10:27 [PATCH net-next] net: airoha: Always check return value from airoha_ppe_foe_get_entry() Lorenzo Bianconi
2025-06-16 16:43 ` Simon Horman
2025-06-17 22:31 ` Jakub Kicinski
2025-06-18 7:39 ` Lorenzo Bianconi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).