Thread View: linux.kernel.netdev
3 messages
3 total messages
Started by Fang Xieyan
Tue, 03 Nov 2026 14:59
[PATCH v2] net: wwan: iosm: drop redundant skb->data check in MUX DL decode
Author: Fang Xieyan
Date: Tue, 03 Nov 2026 14:59
Date: Tue, 03 Nov 2026 14:59
42 lines
9781 bytes
9781 bytes
The skb passed to ipc_mux_dl_decode() through the current RX path
always has a valid data pointer.
The only caller, ipc_imem_dl_skb_process(), checks for a NULL skb
before calling ipc_mux_dl_decode(). The skb is allocated through
ipc_pcie_alloc_skb() -> ipc_pcie_alloc_local_skb() ->
__netdev_alloc_skb(), which provides a valid data buffer on
successful allocation. Allocation or DMA mapping failures return
a NULL skb instead.
Remove the redundant skb->data check.
Suggested-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Reviewed-by: Guanglei Zhu <zhugl3@xiaopeng.com>
Signed-off-by: Fang Xieyan <fangxy@xiaopeng.com>
---
Changes in v2:
- Drop the "fix potential skb leak" approach. The skb->data NULL
condition is unreachable through the current RX path, so remove
the redundant check instead of adding an ipc_pcie_kfree_skb() call.
- Drop the Fixes: tag because this patch does not fix a reachable bug.
drivers/net/wwan/iosm/iosm_ipc_mux_codec.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
index 0bbd41263cc2..2b8a22980c87 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
@@ -693,9 +693,6 @@ void ipc_mux_dl_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb)
{
u32 signature;
- if (!skb->data)
- return;
-
/* Decode the MUX header type. */
signature = le32_to_cpup((__le32 *)skb->data);
--
2.50.1
Re: [PATCH v2] net: wwan: iosm: drop redundant skb->data check in MUX DL decode
Author: Loic Poulain
Date: Tue, 03 Nov 2026 15:13
Date: Tue, 03 Nov 2026 15:13
54 lines
18052 bytes
18052 bytes
On Tue, Nov 3, 2026 at 3:59 PM Fang Xieyan <fangxy@xiaopeng.com> wrote:
>
> The skb passed to ipc_mux_dl_decode() through the current RX path
> always has a valid data pointer.
>
> The only caller, ipc_imem_dl_skb_process(), checks for a NULL skb
> before calling ipc_mux_dl_decode(). The skb is allocated through
> ipc_pcie_alloc_skb() -> ipc_pcie_alloc_local_skb() ->
> __netdev_alloc_skb(), which provides a valid data buffer on
> successful allocation. Allocation or DMA mapping failures return
> a NULL skb instead.
>
> Remove the redundant skb->data check.
>
> Suggested-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
> Reviewed-by: Guanglei Zhu <zhugl3@xiaopeng.com>
> Signed-off-by: Fang Xieyan <fangxy@xiaopeng.com>
On top of that, the early-return branch does not release the related resources.
Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
> ---
> Changes in v2:
> - Drop the "fix potential skb leak" approach. The skb->data NULL
> condition is unreachable through the current RX path, so remove
> the redundant check instead of adding an ipc_pcie_kfree_skb() call.
> - Drop the Fixes: tag because this patch does not fix a reachable bug.
>
> drivers/net/wwan/iosm/iosm_ipc_mux_codec.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
> index 0bbd41263cc2..2b8a22980c87 100644
> --- a/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
> +++ b/drivers/net/wwan/iosm/iosm_ipc_mux_codec.c
> @@ -693,9 +693,6 @@ void ipc_mux_dl_decode(struct iosm_mux *ipc_mux, struct sk_buff *skb)
> {
> u32 signature;
>
> - if (!skb->data)
> - return;
> -
> /* Decode the MUX header type. */
> signature = le32_to_cpup((__le32 *)skb->data);
>
> --
> 2.50.1
>
Re: [PATCH v2] net: wwan: iosm: drop redundant skb->data check in MUX DL decode
Author: patchwork-bot+netdevbpf
Date: Tue, 10 Nov 2026 14:30
Date: Tue, 10 Nov 2026 14:30
27 lines
8831 bytes
8831 bytes
Hello:
This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Tue, 3 Nov 2026 22:59:25 +0800 you wrote:
> The skb passed to ipc_mux_dl_decode() through the current RX path
> always has a valid data pointer.
>
> The only caller, ipc_imem_dl_skb_process(), checks for a NULL skb
> before calling ipc_mux_dl_decode(). The skb is allocated through
> ipc_pcie_alloc_skb() -> ipc_pcie_alloc_local_skb() ->
> __netdev_alloc_skb(), which provides a valid data buffer on
> successful allocation. Allocation or DMA mapping failures return
> a NULL skb instead.
>
> [...]
Here is the summary with links:
- [v2] net: wwan: iosm: drop redundant skb->data check in MUX DL decode
https://git.kernel.org/netdev/net-next/c/66974df65a0b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads