can_put_echo_skb() is a public helper used by CAN drivers. Its existing
skb drop paths use kfree_skb(), which is not suitable when the caller's IRQ
context is unknown.
Convert the existing drop paths to dev_kfree_skb_any(), then make the
invalid echo index path consume its skb with the same helper. This makes
the ownership semantics consistent across all error and drop paths.
Signed-off-by: Cunhao Lu <1579567540@qq.com>
---
Changes in v2:
- Add a preparatory patch replacing the existing kfree_skb() calls in
can_put_echo_skb() with dev_kfree_skb_any().
- Free the skb with dev_kfree_skb_any() on an invalid echo index.
- Collect Vincent's Reviewed-by tag for the binding patch
- Link to v1:
https://lore.kernel.org/linux-can/tencent_944DADCC4B42C8484EC01DA2B15F42132906@qq.com
To: Marc Kleine-Budde <mkl@pengutronix.de>
To: Vincent Mailhol <mailhol@kernel.org>
Cc: linux-can@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
Cunhao Lu (2):
can: dev: can_put_echo_skb(): use dev_kfree_skb_any()
can: dev: can_put_echo_skb(): free skb on invalid echo index
drivers/net/can/dev/skb.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
base-commit: 11028ab62899e4191e074ee364c712b77823a9c4
change-id: 20260730-master-abf3e4067e47
Best regards,
--
Cunhao Lu <1579567540@qq.com>