Linux IEEE 802.15.4 and 6LoWPAN development
 help / color / mirror / Atom feed
From: Stefan Schmidt <stefan@osg.samsung.com>
To: Baozeng Ding <sploving1@gmail.com>,
	aar@pengutronix.de, davem@davemloft.net
Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net] ieee802154: fix logic error in ieee802154_llsec_parse_dev_addr
Date: Fri, 27 May 2016 12:24:23 +0200	[thread overview]
Message-ID: <57482057.1070909@osg.samsung.com> (raw)
In-Reply-To: <7c36848d-28b5-87cc-f998-53cc2428a0a6@gmail.com>

Hello.

On 26/05/16 15:07, Baozeng Ding wrote:
> Fix a logic error to avoid potential null pointer dereference.
>
> Signed-off-by: Baozeng Ding<sploving1@gmail.com>
> ---
>   net/ieee802154/nl802154.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
> index ca207db..116187b 100644
> --- a/net/ieee802154/nl802154.c
> +++ b/net/ieee802154/nl802154.c
> @@ -1289,8 +1289,8 @@ ieee802154_llsec_parse_dev_addr(struct nlattr *nla,
>   				     nl802154_dev_addr_policy))
>   		return -EINVAL;
>   
> -	if (!attrs[NL802154_DEV_ADDR_ATTR_PAN_ID] &&
> -	    !attrs[NL802154_DEV_ADDR_ATTR_MODE] &&
> +	if (!attrs[NL802154_DEV_ADDR_ATTR_PAN_ID] ||
> +	    !attrs[NL802154_DEV_ADDR_ATTR_MODE] ||
>   	    !(attrs[NL802154_DEV_ADDR_ATTR_SHORT] ||
>   	      attrs[NL802154_DEV_ADDR_ATTR_EXTENDED]))
>   		return -EINVAL;

Good catch!

Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>

regards
Stefan Schmidt

  reply	other threads:[~2016-05-27 10:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-26 13:07 [PATCH net] ieee802154: fix logic error in ieee802154_llsec_parse_dev_addr Baozeng Ding
2016-05-27 10:24 ` Stefan Schmidt [this message]
2016-05-30  5:36 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2016-05-26 13:00 [PATCH net] ieee802154: fix logic error in, ieee802154_llsec_parse_dev_addr Baozeng Ding

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=57482057.1070909@osg.samsung.com \
    --to=stefan@osg.samsung.com \
    --cc=aar@pengutronix.de \
    --cc=davem@davemloft.net \
    --cc=linux-wpan@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sploving1@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