From: Szymon Janc <szymon.janc@gmail.com>
To: Jakub Tyszkowski <jakub.tyszkowski@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCHv2 3/3] android/gatt: Fix possible invalid read
Date: Tue, 20 May 2014 23:53:26 +0200 [thread overview]
Message-ID: <3328627.cATsFkAvdn@athlon> (raw)
In-Reply-To: <1400583164-23776-3-git-send-email-jakub.tyszkowski@tieto.com>
Hi Jakub,
On Tuesday 20 May 2014 12:52:44 Jakub Tyszkowski wrote:
> Fix dereferencing attrib before checking if not null.
> ---
> android/gatt.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/android/gatt.c b/android/gatt.c
> index dcb347b..4ff135b 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -554,11 +554,12 @@ static void connection_cleanup(struct gatt_device
> *device) device->att_io = NULL;
> }
>
> - if (device->server_id > 0)
> - g_attrib_unregister(device->attrib, device->server_id);
> -
> if (device->attrib) {
> GAttrib *attrib = device->attrib;
> +
> + if (device->server_id > 0)
> + g_attrib_unregister(device->attrib, device->server_id);
> +
> device->attrib = NULL;
> g_attrib_cancel_all(attrib);
> g_attrib_unref(attrib);
This patch is now applied, thanks.
--
Szymon K. Janc
szymon.janc@gmail.com
next prev parent reply other threads:[~2014-05-20 21:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-20 10:52 [PATCHv2 1/3] android/gatt: Send Exchange MTU request on connect Jakub Tyszkowski
2014-05-20 10:52 ` [PATCHv2 2/3] android/gatt: Use g_attrib buffer where possible for att Jakub Tyszkowski
2014-05-20 10:52 ` [PATCHv2 3/3] android/gatt: Fix possible invalid read Jakub Tyszkowski
2014-05-20 21:53 ` Szymon Janc [this message]
2014-05-20 21:52 ` [PATCHv2 1/3] android/gatt: Send Exchange MTU request on connect Szymon Janc
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=3328627.cATsFkAvdn@athlon \
--to=szymon.janc@gmail.com \
--cc=jakub.tyszkowski@tieto.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