linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: SpoorthiX K <spoorthix.k@intel.com>
Cc: "open list:BLUETOOTH DRIVERS" <linux-bluetooth@vger.kernel.org>,
	Marcel Holtmann <marcel@holtmann.org>
Subject: Re: [PATCH] Add support to use Resolving list
Date: Fri, 27 Sep 2019 10:14:36 +0300	[thread overview]
Message-ID: <4A7F9C6A-9F69-43A2-864A-EDB4EB69D2DE@gmail.com> (raw)
In-Reply-To: <1568802985-9990-1-git-send-email-spoorthix.k@intel.com>

Hi Spoorthi,

On 18 Sep 2019, at 13.36, spoorthix.k@intel.com wrote:
> +static void add_to_resolve_list(struct hci_request *req,
> +				struct hci_conn_params *params)
> +{
> +	struct hci_cp_le_add_to_resolv_list cp;
> +	struct bdaddr_list_with_irk *entry;
> +
> +	entry = kzalloc(sizeof(*entry), GFP_KERNEL);
> +	if (!entry)
> +		return;
> +
> +	memset(&cp, 0, sizeof(cp));
> +
> +	cp.bdaddr_type = params->addr_type;
> +	bacpy(&cp.bdaddr, &params->addr);
> +	memcpy(entry->peer_irk, cp.peer_irk, 16);
> +	memcpy(entry->local_irk, cp.local_irk, 16);
> +
> +	hci_req_add(req, HCI_OP_LE_ADD_TO_RESOLV_LIST, sizeof(cp), &cp);
> +}

Are you missing a call to add the entry to some list here? As it stands now this just results in the allocated memory being leaked. Where & when should it be freed?

Johan

  parent reply	other threads:[~2019-09-27  7:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18 10:36 [PATCH] Add support to use Resolving list spoorthix.k
2019-09-27  7:07 ` Marcel Holtmann
2019-09-27  7:14 ` Johan Hedberg [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-08-30  8:13 [PATCH] Add Support " spoorthix.k
2019-09-05 15:43 ` Marcel Holtmann
2019-08-29  7:22 [PATCH] Add Support to use Resolving List spoorthix.k
2019-08-29 19:11 ` kbuild test robot
2019-08-14  8:18 [PATCH] Add support to use resolving list spoorthix.k
2019-08-15  6:56 ` Marcel Holtmann
2019-08-12 10:49 spoorthix.k
2019-08-12 18:15 ` kbuild test robot

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=4A7F9C6A-9F69-43A2-864A-EDB4EB69D2DE@gmail.com \
    --to=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=spoorthix.k@intel.com \
    /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 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).