From: Szymon Janc <szymon.janc@tieto.com>
To: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/7] android/handsfree: Check service class is not zero
Date: Thu, 17 Apr 2014 14:54:35 +0200 [thread overview]
Message-ID: <2086828.EMa9AY2hXh@uw000953> (raw)
In-Reply-To: <1397737431-6101-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
Hi Andrei,
On Thursday 17 of April 2014 15:23:45 Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
>
> Fixes static analyzers NULL dereference warnings. The similar check is
> done in src/device.c in line 2959.
> ---
> android/handsfree.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/android/handsfree.c b/android/handsfree.c
> index 02b6dad..c8026a0 100644
> --- a/android/handsfree.c
> +++ b/android/handsfree.c
> @@ -1405,6 +1405,9 @@ static void sdp_hsp_search_cb(sdp_list_t *recs, int err, gpointer data)
> goto fail;
> }
>
> + if (!classes)
> + goto fail;
> +
This is already checked :
if (sdp_get_service_classes(recs->data, &classes) < 0 || !classes) {
error("handsfree: unable to get service classes from record");
goto fail;
}
What kind of warning do you get from static analyzer?
> if (sdp_get_access_protos(recs->data, &protos) < 0) {
> error("handsfree: unable to get access protocols from record");
> sdp_list_free(classes, free);
> @@ -1495,6 +1498,9 @@ static void sdp_hfp_search_cb(sdp_list_t *recs, int err, gpointer data)
> goto fail;
> }
>
> + if (!classes)
> + goto fail;
> +
Ditto.
> if (sdp_get_access_protos(recs->data, &protos) < 0) {
> error("handsfree: unable to get access protocols from record");
> sdp_list_free(classes, free);
>
--
Best regards,
Szymon Janc
prev parent reply other threads:[~2014-04-17 12:54 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-17 12:23 [PATCH 1/7] android/handsfree: Check service class is not zero Andrei Emeltchenko
2014-04-17 12:23 ` [PATCH 2/7] android/hal-audio-hsp: Add audio HAL for HSP handling Andrei Emeltchenko
2014-04-17 13:00 ` Szymon Janc
2014-04-17 12:23 ` [PATCH 3/7] android/hal-audio: Make code readable Andrei Emeltchenko
2014-04-17 13:02 ` Szymon Janc
2014-04-17 12:23 ` [PATCH 4/7] android/hal-audio-hsp: Add open_output_stream() Andrei Emeltchenko
2014-04-17 12:23 ` [PATCH 5/7] android/hal-audio: Add SCO audio API Andrei Emeltchenko
2014-04-17 13:20 ` Szymon Janc
2014-04-22 15:36 ` Luiz Augusto von Dentz
2014-04-23 14:06 ` Jesse Koegler
2014-04-23 18:41 ` Luiz Augusto von Dentz
2014-04-23 18:59 ` Jesse Koegler
2014-04-17 12:23 ` [PATCH 6/7] android/ipc: Use error printing error messages Andrei Emeltchenko
2014-04-17 13:23 ` Szymon Janc
2014-04-17 12:23 ` [PATCH 7/7] android/handsfree: trivial: Correct comment style Andrei Emeltchenko
2014-04-17 13:26 ` Szymon Janc
2014-04-17 12:54 ` Szymon Janc [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=2086828.EMa9AY2hXh@uw000953 \
--to=szymon.janc@tieto.com \
--cc=Andrei.Emeltchenko.news@gmail.com \
--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 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).