Re: [PATCH] libertas: fix possible NULL dereference

2015-11-23 Thread Sudip Mukherjee
On Tue, Nov 24, 2015 at 01:43:38AM +0200, Andy Shevchenko wrote:
> On Mon, Nov 23, 2015 at 2:32 PM, Sudip Mukherjee
>  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.

I will send v2 with modified commit message.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] libertas: fix possible NULL dereference

2015-11-23 Thread Andy Shevchenko
On Mon, Nov 23, 2015 at 2:32 PM, Sudip Mukherjee
 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 
> ---
>  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 = >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 majord...@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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] libertas: fix possible NULL dereference

2015-11-23 Thread Sudip Mukherjee
We were dereferencing cmd first and checking for NULL later. Lets first
check for NULL.

Signed-off-by: Sudip Mukherjee 
---
 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 = >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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] libertas: fix possible NULL dereference

2015-11-23 Thread Sudip Mukherjee
We were dereferencing cmd first and checking for NULL later. Lets first
check for NULL.

Signed-off-by: Sudip Mukherjee 
---
 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 = >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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] libertas: fix possible NULL dereference

2015-11-23 Thread Andy Shevchenko
On Mon, Nov 23, 2015 at 2:32 PM, Sudip Mukherjee
 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 
> ---
>  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 = >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 majord...@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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] libertas: fix possible NULL dereference

2015-11-23 Thread Sudip Mukherjee
On Tue, Nov 24, 2015 at 01:43:38AM +0200, Andy Shevchenko wrote:
> On Mon, Nov 23, 2015 at 2:32 PM, Sudip Mukherjee
>  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.

I will send v2 with modified commit message.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/