All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Kalle Valo <kvalo@codeaurora.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	libertas-dev@lists.infradead.org,
	"open list:TI WILINK WIRELES..." <linux-wireless@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH] libertas: fix possible NULL dereference
Date: Tue, 24 Nov 2015 01:43:38 +0200	[thread overview]
Message-ID: <CAHp75Veb4UBKrGsODoKnZrvOZUTEm78yBvhmBRn68oZYRecdQA@mail.gmail.com> (raw)
In-Reply-To: <1448281922-20382-1-git-send-email-sudipm.mukherjee@gmail.com>

On Mon, Nov 23, 2015 at 2:32 PM, Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:
> We were dereferencing cmd first and checking for NULL later. Lets first
> check for NULL.

However the patch is valid due to reducing error prone part, the
commit message seems wrong.
There is no dereferencing, it is a simple pointer arithmetic.

>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
>  drivers/net/wireless/marvell/libertas/cfg.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/marvell/libertas/cfg.c b/drivers/net/wireless/marvell/libertas/cfg.c
> index 8317afd..e38ad1d 100644
> --- a/drivers/net/wireless/marvell/libertas/cfg.c
> +++ b/drivers/net/wireless/marvell/libertas/cfg.c
> @@ -1108,7 +1108,7 @@ static int lbs_associate(struct lbs_private *priv,
>         size_t len, resp_ie_len;
>         int status;
>         int ret;
> -       u8 *pos = &(cmd->iebuf[0]);
> +       u8 *pos;
>         u8 *tmp;
>
>         lbs_deb_enter(LBS_DEB_CFG80211);
> @@ -1117,6 +1117,7 @@ static int lbs_associate(struct lbs_private *priv,
>                 ret = -ENOMEM;
>                 goto done;
>         }
> +       pos = &cmd->iebuf[0];
>
>         /*
>          * cmd              50 00
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2015-11-23 23:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-23 12:32 [PATCH] libertas: fix possible NULL dereference Sudip Mukherjee
2015-11-23 23:43 ` Andy Shevchenko [this message]
2015-11-24  7:32   ` Sudip Mukherjee
2015-12-07 18:03 ` Fixing full name in patchwork Kalle Valo
2015-12-08  4:54   ` Sudip Mukherjee
2015-12-08  7:54     ` Kalle Valo
2015-12-08  8:21       ` Sudip Mukherjee
2015-12-08  8:30         ` Kalle Valo

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=CAHp75Veb4UBKrGsODoKnZrvOZUTEm78yBvhmBRn68oZYRecdQA@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=kvalo@codeaurora.org \
    --cc=libertas-dev@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sudipm.mukherjee@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 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.