diff mbox series

[v2,2/2] Bluetooth: A2MP: Fix not setting request ID

Message ID 20201019172529.1179996-2-luiz.dentz@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/2] Bluetooth: Fix not checking advertisement bondaries | expand

Commit Message

Luiz Augusto von Dentz Oct. 19, 2020, 5:25 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This fixes not resetting of the request ID when sending
A2MP_GETAMPASSOC_RSP.

Fixes: Bluetooth: A2MP: Fix not initializing all members
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/a2mp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Johan Hedberg Oct. 22, 2020, 9 p.m. UTC | #1
Hi Luiz,

On Mon, Oct 19, 2020, Luiz Augusto von Dentz wrote:
> This fixes not resetting of the request ID when sending
> A2MP_GETAMPASSOC_RSP.
> 
> Fixes: Bluetooth: A2MP: Fix not initializing all members
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
>  net/bluetooth/a2mp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

The fix itself looks fine, but I think the "Fixes: ..." line should
contain the commit id followed by the commit summary within parentheses,
at least based on how I can see this style of annotation used in other
commits in the tree.

Johan
Luiz Augusto von Dentz Oct. 22, 2020, 9:09 p.m. UTC | #2
Hi Johan,

On Thu, Oct 22, 2020 at 2:00 PM Johan Hedberg <johan.hedberg@gmail.com> wrote:
>
> Hi Luiz,
>
> On Mon, Oct 19, 2020, Luiz Augusto von Dentz wrote:
> > This fixes not resetting of the request ID when sending
> > A2MP_GETAMPASSOC_RSP.
> >
> > Fixes: Bluetooth: A2MP: Fix not initializing all members
> > Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> > ---
> >  net/bluetooth/a2mp.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
>
> The fix itself looks fine, but I think the "Fixes: ..." line should
> contain the commit id followed by the commit summary within parentheses,
> at least based on how I can see this style of annotation used in other
> commits in the tree.

I did not add a commit id because it did not reached the Linus tree
yet and we cannot use the one from bluetooth-next since that tree is
rebased then the commit id might change so I thought the only way to
do it is by commit message.
Johan Hedberg Oct. 23, 2020, 8:54 a.m. UTC | #3
Hi Luiz,

On Thu, Oct 22, 2020, Luiz Augusto von Dentz wrote:
> > On Mon, Oct 19, 2020, Luiz Augusto von Dentz wrote:
> > > This fixes not resetting of the request ID when sending
> > > A2MP_GETAMPASSOC_RSP.
> > >
> > > Fixes: Bluetooth: A2MP: Fix not initializing all members
> > > Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> > > ---
> > >  net/bluetooth/a2mp.c | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > The fix itself looks fine, but I think the "Fixes: ..." line should
> > contain the commit id followed by the commit summary within parentheses,
> > at least based on how I can see this style of annotation used in other
> > commits in the tree.
> 
> I did not add a commit id because it did not reached the Linus tree
> yet

Yes it did:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eddb7732119d53400f48a02536a84c509692faa8

Johan
Luiz Augusto von Dentz Oct. 24, 2020, 12:24 a.m. UTC | #4
Hi Johan,

On Fri, Oct 23, 2020 at 1:54 AM Johan Hedberg <johan.hedberg@gmail.com> wrote:
>
> Hi Luiz,
>
> On Thu, Oct 22, 2020, Luiz Augusto von Dentz wrote:
> > > On Mon, Oct 19, 2020, Luiz Augusto von Dentz wrote:
> > > > This fixes not resetting of the request ID when sending
> > > > A2MP_GETAMPASSOC_RSP.
> > > >
> > > > Fixes: Bluetooth: A2MP: Fix not initializing all members
> > > > Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> > > > ---
> > > >  net/bluetooth/a2mp.c | 3 ++-
> > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > The fix itself looks fine, but I think the "Fixes: ..." line should
> > > contain the commit id followed by the commit summary within parentheses,
> > > at least based on how I can see this style of annotation used in other
> > > commits in the tree.
> >
> > I did not add a commit id because it did not reached the Linus tree
> > yet
>
> Yes it did:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eddb7732119d53400f48a02536a84c509692faa8

Somehow I missed that, or git.kernel.org was playing tricks on me, Ive
now updated the v3 to include it.

> Johan
diff mbox series

Patch

diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c
index da7fd7c8c2dc..7a1e0b785f45 100644
--- a/net/bluetooth/a2mp.c
+++ b/net/bluetooth/a2mp.c
@@ -381,10 +381,11 @@  static int a2mp_getampassoc_req(struct amp_mgr *mgr, struct sk_buff *skb,
 	hdev = hci_dev_get(req->id);
 	if (!hdev || hdev->amp_type == AMP_TYPE_BREDR || tmp) {
 		struct a2mp_amp_assoc_rsp rsp;
-		rsp.id = req->id;
 
 		memset(&rsp, 0, sizeof(rsp));
 
+		rsp.id = req->id;
+
 		if (tmp) {
 			rsp.status = A2MP_STATUS_COLLISION_OCCURED;
 			amp_mgr_put(tmp);