All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christopher William Snowhill" <chris@kode54.net>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH] Fix initializing response id after clearing struct
Date: Sat, 26 Dec 2020 19:12:32 -0800	[thread overview]
Message-ID: <f2e0ca7e-4ffa-4e39-bd46-e0f70d23567e@www.fastmail.com> (raw)

Looks like this was missed when patching the source to clear the structures throughout, causing this one instance to clear the struct after the response id is assigned.

This is in regard to Message ID <20200806181714.3216076-1-luiz.dentz@gmail.com>,
subject: [PATCH 1/4] Bluetooth: A2MP: Fix not initializing all members

I must apologize for not noticing this sooner, as I remember reading the articles linking to this patch several months ago. Either it slipped my mind, or I failed to notice it then. Apparently, nobody else noticed it, either, so I guess it's just not that obvious.

---
 net/bluetooth/a2mp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c
index da7fd7c8c2dc0..7a1e0b785f459 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);

             reply	other threads:[~2020-12-27  3:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-27  3:12 Christopher William Snowhill [this message]
2020-12-27  4:24 ` Fix initializing response id after clearing struct bluez.test.bot
2020-12-27 20:36 ` [PATCH] " Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f2e0ca7e-4ffa-4e39-bd46-e0f70d23567e@www.fastmail.com \
    --to=chris@kode54.net \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.