All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Fugang Duan <b38611@freescale.com>
Cc: marcel@holtmann.org, johannes.berg@intel.com, jslaby@suse.cz,
	linux-bluetooth@vger.kernel.org, fugang.duan@nxp.com
Subject: Re: [PATCH] Bluetooth: add hdev check to avoid passing null pointer
Date: Thu, 21 Jan 2016 09:43:10 +0100	[thread overview]
Message-ID: <20160121084310.GA4046@t440s> (raw)
In-Reply-To: <1453351558-7726-1-git-send-email-b38611@freescale.com>

Hi Fuang,

On Thu, Jan 21, 2016, Fugang Duan wrote:
> Function hci_mgmt_cmd() may pass hdev with null pointer to hci_mgmt_handler->func()
> like below code:
> 	err = handler->func(sk, hdev, cp, len);
> 
> Add hdev check to avoid passing null pointer.
> 
> Signed-off-by: Fugang Duan <B38611@freescale.com>
> ---
>  net/bluetooth/hci_sock.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
> index 1298d72..7fdfc80 100644
> --- a/net/bluetooth/hci_sock.c
> +++ b/net/bluetooth/hci_sock.c
> @@ -1186,6 +1186,8 @@ static int hci_mgmt_cmd(struct hci_mgmt_chan *chan, struct sock *sk,
>  
>  	if (hdev && chan->hdev_init)
>  		chan->hdev_init(sk, hdev);
> +	else if (!hdev)
> +		goto done;

Why are you resending this? Did you see my response to your earlier
submission?

Johan

  reply	other threads:[~2016-01-21  8:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21  4:45 [PATCH] Bluetooth: add hdev check to avoid passing null pointer Fugang Duan
2016-01-21  8:43 ` Johan Hedberg [this message]
2016-01-21  9:06   ` Fugang Duan
  -- strict thread matches above, loose matches on Subject: below --
2016-01-19 10:34 Fugang Duan
2016-01-19 13:04 ` Johan Hedberg
2016-01-21  9:23   ` Fugang Duan

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=20160121084310.GA4046@t440s \
    --to=johan.hedberg@gmail.com \
    --cc=b38611@freescale.com \
    --cc=fugang.duan@nxp.com \
    --cc=johannes.berg@intel.com \
    --cc=jslaby@suse.cz \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.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.