linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gix, Brian" <brian.gix@intel.com>
To: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Cc: "luiz.dentz@gmail.com" <luiz.dentz@gmail.com>
Subject: Re: [PATCH BlueZ] tools: Fix static analysis warnings
Date: Tue, 26 Jan 2021 21:31:25 +0000	[thread overview]
Message-ID: <31facf7f3b7b5e00c21ada1048990788a388b02c.camel@intel.com> (raw)
In-Reply-To: <20210122194258.538970-1-brian.gix@intel.com>

Applied

On Fri, 2021-01-22 at 11:42 -0800, Brian Gix wrote:
> Usage of potentially NULL pointers
> ---
>  tools/btmgmt.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/tools/btmgmt.c b/tools/btmgmt.c
> index 383e7199e..f4eb541fa 100644
> --- a/tools/btmgmt.c
> +++ b/tools/btmgmt.c
> @@ -4912,6 +4912,12 @@ static void cmd_advmon_add_pattern(int argc, char **argv)
>  
>  	cp_len = sizeof(*cp) + argc * sizeof(struct mgmt_adv_pattern);
>  	cp = malloc0(cp_len);
> +	if (!cp) {
> +		error("Failed to alloc patterns.");
> +		success = false;
> +		goto done;
> +	}
> +
>  	cp->pattern_count = argc;
>  
>  	for (i = 0; i < argc; i++) {
> @@ -4987,6 +4993,12 @@ static void cmd_advmon_add_pattern_rssi(int argc, char **argv)
>  
>  	cp_len = sizeof(*cp) + argc * sizeof(struct mgmt_adv_pattern);
>  	cp = malloc0(cp_len);
> +	if (!cp) {
> +		error("Failed to alloc patterns.");
> +		success = false;
> +		goto done;
> +	}
> +
>  	cp->pattern_count = argc;
>  	cp->rssi.high_threshold = rssi_high;
>  	cp->rssi.low_threshold = rssi_low;

      parent reply	other threads:[~2021-01-26 22:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 19:42 [PATCH BlueZ] tools: Fix static analysis warnings Brian Gix
2021-01-22 22:58 ` [BlueZ] " bluez.test.bot
2021-01-26 21:31 ` Gix, Brian [this message]

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=31facf7f3b7b5e00c21ada1048990788a388b02c.camel@intel.com \
    --to=brian.gix@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.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).