linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_uart: Fix uninitialized alignment value
@ 2017-07-29 17:32 Loic Poulain
  2017-07-31 10:28 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Loic Poulain @ 2017-07-29 17:32 UTC (permalink / raw)
  To: marcel; +Cc: linux-bluetooth, Loic Poulain

Force alignment value to the default one (1 byte) if uninitialized.
This fixes hci_ll serdev driver (alignment = 0) and avoid any further
issues with upcoming drivers.

Signed-off-by: Loic Poulain <loic.poulain@gmail.com>
---
 drivers/bluetooth/hci_h4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c
index 4e328d7..3b82a87 100644
--- a/drivers/bluetooth/hci_h4.c
+++ b/drivers/bluetooth/hci_h4.c
@@ -172,7 +172,7 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb,
 			    const struct h4_recv_pkt *pkts, int pkts_count)
 {
 	struct hci_uart *hu = hci_get_drvdata(hdev);
-	u8 alignment = hu->alignment;
+	u8 alignment = hu->alignment ? hu->alignment : 1;
 
 	while (count) {
 		int i, len;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: hci_uart: Fix uninitialized alignment value
  2017-07-29 17:32 [PATCH] Bluetooth: hci_uart: Fix uninitialized alignment value Loic Poulain
@ 2017-07-31 10:28 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2017-07-31 10:28 UTC (permalink / raw)
  To: Loic Poulain; +Cc: linux-bluetooth

Hi Loic,

On Sat, Jul 29, 2017, Loic Poulain wrote:
> Force alignment value to the default one (1 byte) if uninitialized.
> This fixes hci_ll serdev driver (alignment = 0) and avoid any further
> issues with upcoming drivers.
> 
> Signed-off-by: Loic Poulain <loic.poulain@gmail.com>
> ---
>  drivers/bluetooth/hci_h4.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to bluetooth-next. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-31 10:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-29 17:32 [PATCH] Bluetooth: hci_uart: Fix uninitialized alignment value Loic Poulain
2017-07-31 10:28 ` Johan Hedberg

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).