e490333a9bbf025e0a9d6c4f32155b19327c0dbe
[openwrt/staging/xback.git] /
1 From: Dan Carpenter <dan.carpenter@oracle.com>
2 Date: Thu, 19 May 2022 17:08:00 +0300
3 Subject: [PATCH] net: ethernet: mtk_eth_soc: fix error code in
4 mtk_flow_offload_replace()
5
6 Preserve the error code from mtk_foe_entry_commit(). Do not return
7 success.
8
9 Fixes: c4f033d9e03e ("net: ethernet: mtk_eth_soc: rework hardware flow table management")
10 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
11 Signed-off-by: David S. Miller <davem@davemloft.net>
12 ---
13
14 --- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
15 +++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
16 @@ -434,7 +434,8 @@ mtk_flow_offload_replace(struct mtk_eth
17 memcpy(&entry->data, &foe, sizeof(entry->data));
18 entry->wed_index = wed_index;
19
20 - if (mtk_foe_entry_commit(eth->ppe, entry) < 0)
21 + err = mtk_foe_entry_commit(eth->ppe, entry);
22 + if (err < 0)
23 goto free;
24
25 err = rhashtable_insert_fast(&eth->flow_table, &entry->node,