All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] Bluetooth: fix breakage in amp_write_rem_assoc_frag()
@ 2015-08-01 12:30 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2015-08-01 12:30 UTC (permalink / raw)
  To: Marcel Holtmann, Arron Wang
  Cc: Gustavo Padovan, Johan Hedberg, linux-bluetooth, kernel-janitors

We should be passing the pointer itself instead of the address of the
pointer.

This was a copy and paste bug when we replaced the calls to
hci_send_cmd().  Originally, the arguments were "len, cp" but we
overwrote them with "sizeof(cp), &cp" by mistake.

Fixes: b3d3914006a0 ('Bluetooth: Move amp assoc read/write completed callback to amp.c')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I'm pretty sure this is correct, but it's a static checker fix and I
haven't tested it.

diff --git a/net/bluetooth/amp.c b/net/bluetooth/amp.c
index 238ddd3..e32f341 100644
--- a/net/bluetooth/amp.c
+++ b/net/bluetooth/amp.c
@@ -379,7 +379,7 @@ static bool amp_write_rem_assoc_frag(struct hci_dev *hdev,
 	amp_ctrl_put(ctrl);
 
 	hci_req_init(&req, hdev);
-	hci_req_add(&req, HCI_OP_WRITE_REMOTE_AMP_ASSOC, sizeof(cp), &cp);
+	hci_req_add(&req, HCI_OP_WRITE_REMOTE_AMP_ASSOC, len, cp);
 	hci_req_run_skb(&req, write_remote_amp_assoc_complete);
 
 	kfree(cp);

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

* [patch] Bluetooth: fix breakage in amp_write_rem_assoc_frag()
@ 2015-08-01 12:30 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2015-08-01 12:30 UTC (permalink / raw)
  To: Marcel Holtmann, Arron Wang
  Cc: Gustavo Padovan, Johan Hedberg, linux-bluetooth, kernel-janitors

We should be passing the pointer itself instead of the address of the
pointer.

This was a copy and paste bug when we replaced the calls to
hci_send_cmd().  Originally, the arguments were "len, cp" but we
overwrote them with "sizeof(cp), &cp" by mistake.

Fixes: b3d3914006a0 ('Bluetooth: Move amp assoc read/write completed callback to amp.c')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I'm pretty sure this is correct, but it's a static checker fix and I
haven't tested it.

diff --git a/net/bluetooth/amp.c b/net/bluetooth/amp.c
index 238ddd3..e32f341 100644
--- a/net/bluetooth/amp.c
+++ b/net/bluetooth/amp.c
@@ -379,7 +379,7 @@ static bool amp_write_rem_assoc_frag(struct hci_dev *hdev,
 	amp_ctrl_put(ctrl);
 
 	hci_req_init(&req, hdev);
-	hci_req_add(&req, HCI_OP_WRITE_REMOTE_AMP_ASSOC, sizeof(cp), &cp);
+	hci_req_add(&req, HCI_OP_WRITE_REMOTE_AMP_ASSOC, len, cp);
 	hci_req_run_skb(&req, write_remote_amp_assoc_complete);
 
 	kfree(cp);

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

* Re: [patch] Bluetooth: fix breakage in amp_write_rem_assoc_frag()
  2015-08-01 12:30 ` Dan Carpenter
@ 2015-08-01 13:20   ` Marcel Holtmann
  -1 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2015-08-01 13:20 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Arron Wang, Gustavo F. Padovan, Johan Hedberg, BlueZ development,
	kernel-janitors

Hi Dan,

> We should be passing the pointer itself instead of the address of the
> pointer.
> 
> This was a copy and paste bug when we replaced the calls to
> hci_send_cmd().  Originally, the arguments were "len, cp" but we
> overwrote them with "sizeof(cp), &cp" by mistake.
> 
> Fixes: b3d3914006a0 ('Bluetooth: Move amp assoc read/write completed callback to amp.c')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> I'm pretty sure this is correct, but it's a static checker fix and I
> haven't tested it.

it is correct and patch has been applied to bluetooth-next tree.

Regards

Marcel


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

* Re: [patch] Bluetooth: fix breakage in amp_write_rem_assoc_frag()
@ 2015-08-01 13:20   ` Marcel Holtmann
  0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2015-08-01 13:20 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Arron Wang, Gustavo F. Padovan, Johan Hedberg, BlueZ development,
	kernel-janitors

Hi Dan,

> We should be passing the pointer itself instead of the address of the
> pointer.
> 
> This was a copy and paste bug when we replaced the calls to
> hci_send_cmd().  Originally, the arguments were "len, cp" but we
> overwrote them with "sizeof(cp), &cp" by mistake.
> 
> Fixes: b3d3914006a0 ('Bluetooth: Move amp assoc read/write completed callback to amp.c')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> I'm pretty sure this is correct, but it's a static checker fix and I
> haven't tested it.

it is correct and patch has been applied to bluetooth-next tree.

Regards

Marcel


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

end of thread, other threads:[~2015-08-01 13:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-01 12:30 [patch] Bluetooth: fix breakage in amp_write_rem_assoc_frag() Dan Carpenter
2015-08-01 12:30 ` Dan Carpenter
2015-08-01 13:20 ` Marcel Holtmann
2015-08-01 13:20   ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.