🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Eric Dumazet Fri, 16 Oct 2026 15:03
[PATCH -next] Bluetooth: hci_nokia: use skb_put_padto()
#4054
Author: Eric Dumazet
Date: Fri, 16 Oct 2026 15:03
36 lines
6197 bytes
skb_pad() does not change skb->len, callers have to follow it
with skb_put(), which is error prone.

Use skb_put_padto() instead of the open-coded sequence in
nokia_enqueue().

Signed-off-by: Eric Dumazet <edumazet@kernel.org>
---
Part of a medium term plan to get rid of skb_pad(), source of many mistakes.

 drivers/bluetooth/hci_nokia.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/bluetooth/hci_nokia.c b/drivers/bluetooth/hci_nokia.c
index be2923231e7128350156bd77ed3cd426c4b31b24..2866d4b54a537ba71a1c602d170debb3d2a697f4 100644
--- a/drivers/bluetooth/hci_nokia.c
+++ b/drivers/bluetooth/hci_nokia.c
@@ -531,12 +531,9 @@ static int nokia_enqueue(struct hci_uart *hu, struct sk_buff *skb)
 	memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
 
 	/* Packets must be word aligned */
-	if (skb->len % 2) {
-		err = skb_pad(skb, 1);
-		if (err)
-			return err;
-		skb_put(skb, 1);
-	}
+	err = skb_put_padto(skb, round_up(skb->len, 2));
+	if (err)
+		return err;
 
 	skb_queue_tail(&btdev->txq, skb);
 
-- 
2.53.0
Re: [PATCH -next] Bluetooth: hci_nokia: use skb_put_padto()
#4060
Author: patchwork-bot+bluetooth
Date: Fri, 16 Oct 2026 15:40
25 lines
6203 bytes
Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Fri, 16 Oct 2026 17:03:14 +0200 you wrote:
> skb_pad() does not change skb->len, callers have to follow it
> with skb_put(), which is error prone.
> 
> Use skb_put_padto() instead of the open-coded sequence in
> nokia_enqueue().
> 
> Signed-off-by: Eric Dumazet <edumazet@kernel.org>
> 
> [...]

Here is the summary with links:
  - [-next] Bluetooth: hci_nokia: use skb_put_padto()
    https://git.kernel.org/bluetooth/bluetooth-next/c/185c11232d5f

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