[PATCH v1] libertas: avoid potential null-pointer dereference

Andy Shevchenko andy.shevchenko at gmail.com
Thu Jan 8 00:06:52 PST 2015


On Thu, Jan 8, 2015 at 1:18 AM, Andy Shevchenko
<andy.shevchenko at gmail.com> wrote:
> We have to check pointer before dereferencing it.

It seems it's correct in initial form. Discard this and sorry for noise.

>
> Reported-by: Andrey Karpov <karpov at viva64.com>
> Signed-off-by: Andy Shevchenko <andy.shevchenko at gmail.com>
> ---
>  drivers/net/wireless/libertas/cfg.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
> index 34f09ef..1d335e6 100644
> --- a/drivers/net/wireless/libertas/cfg.c
> +++ b/drivers/net/wireless/libertas/cfg.c
> @@ -1109,7 +1109,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);
> @@ -1138,6 +1138,8 @@ static int lbs_associate(struct lbs_private *priv,
>         cmd->listeninterval = cpu_to_le16(MRVDRV_DEFAULT_LISTEN_INTERVAL);
>         cmd->capability = cpu_to_le16(bss->capability);
>
> +       pos = cmd->iebuf;
> +
>         /* add SSID TLV */
>         rcu_read_lock();
>         ssid_eid = ieee80211_bss_get_ie(bss, WLAN_EID_SSID);
> --
> 1.8.3.101.g727a46b
>



-- 
With Best Regards,
Andy Shevchenko



More information about the libertas-dev mailing list