Re: [PATCH 2/2] mwifiex: use 'total_ie_len' in mwifiex_update_bss_desc_with_ie()

2019-10-01 Thread Kalle Valo
Brian Norris  wrote:

> This is clearer than copy/pasting the magic number '+ 2' around, and it
> even saves the need for one existing comment.
> 
> Cc: Takashi Iwai 
> Signed-off-by: Brian Norris 
> Reviewed-by: Takashi Iwai 

Patch applied to wireless-drivers-next.git, thanks.

0a3ce169476f mwifiex: use 'total_ie_len' in mwifiex_update_bss_desc_with_ie()

-- 
https://patchwork.kernel.org/patch/10996893/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



Re: [PATCH 2/2] mwifiex: use 'total_ie_len' in mwifiex_update_bss_desc_with_ie()

2019-06-24 Thread Kalle Valo
Brian Norris  wrote:

> This is clearer than copy/pasting the magic number '+ 2' around, and it
> even saves the need for one existing comment.
> 
> Cc: Takashi Iwai 
> Signed-off-by: Brian Norris 
> Reviewed-by: Takashi Iwai 

This depends on:

63d7ef36103d mwifiex: Don't abort on small, spec-compliant vendor IEs

Patch set to Awaiting Upstream.

-- 
https://patchwork.kernel.org/patch/10996893/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



Re: [PATCH 2/2] mwifiex: use 'total_ie_len' in mwifiex_update_bss_desc_with_ie()

2019-06-17 Thread Takashi Iwai
On Sat, 15 Jun 2019 02:13:21 +0200,
Brian Norris wrote:
> 
> This is clearer than copy/pasting the magic number '+ 2' around, and it
> even saves the need for one existing comment.
> 
> Cc: Takashi Iwai 
> Signed-off-by: Brian Norris 

Reviewed-by: Takashi Iwai 


thanks,

Takashi


[PATCH 2/2] mwifiex: use 'total_ie_len' in mwifiex_update_bss_desc_with_ie()

2019-06-14 Thread Brian Norris
This is clearer than copy/pasting the magic number '+ 2' around, and it
even saves the need for one existing comment.

Cc: Takashi Iwai 
Signed-off-by: Brian Norris 
---
 drivers/net/wireless/marvell/mwifiex/scan.c | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c 
b/drivers/net/wireless/marvell/mwifiex/scan.c
index e2786ab612ca..707e5159262f 100644
--- a/drivers/net/wireless/marvell/mwifiex/scan.c
+++ b/drivers/net/wireless/marvell/mwifiex/scan.c
@@ -1269,7 +1269,7 @@ int mwifiex_update_bss_desc_with_ie(struct 
mwifiex_adapter *adapter,
break;
 
case WLAN_EID_FH_PARAMS:
-   if (element_len + 2 < sizeof(*fh_param_set))
+   if (total_ie_len < sizeof(*fh_param_set))
return -EINVAL;
fh_param_set =
(struct ieee_types_fh_param_set *) current_ptr;
@@ -1279,7 +1279,7 @@ int mwifiex_update_bss_desc_with_ie(struct 
mwifiex_adapter *adapter,
break;
 
case WLAN_EID_DS_PARAMS:
-   if (element_len + 2 < sizeof(*ds_param_set))
+   if (total_ie_len < sizeof(*ds_param_set))
return -EINVAL;
ds_param_set =
(struct ieee_types_ds_param_set *) current_ptr;
@@ -1292,7 +1292,7 @@ int mwifiex_update_bss_desc_with_ie(struct 
mwifiex_adapter *adapter,
break;
 
case WLAN_EID_CF_PARAMS:
-   if (element_len + 2 < sizeof(*cf_param_set))
+   if (total_ie_len < sizeof(*cf_param_set))
return -EINVAL;
cf_param_set =
(struct ieee_types_cf_param_set *) current_ptr;
@@ -1302,7 +1302,7 @@ int mwifiex_update_bss_desc_with_ie(struct 
mwifiex_adapter *adapter,
break;
 
case WLAN_EID_IBSS_PARAMS:
-   if (element_len + 2 < sizeof(*ibss_param_set))
+   if (total_ie_len < sizeof(*ibss_param_set))
return -EINVAL;
ibss_param_set =
(struct ieee_types_ibss_param_set *)
@@ -1459,10 +1459,8 @@ int mwifiex_update_bss_desc_with_ie(struct 
mwifiex_adapter *adapter,
break;
}
 
-   current_ptr += element_len + 2;
-
-   /* Need to account for IE ID and IE Len */
-   bytes_left -= (element_len + 2);
+   current_ptr += total_ie_len;
+   bytes_left -= total_ie_len;
 
}   /* while (bytes_left > 2) */
return ret;
-- 
2.22.0.410.gd8fdbe21b5-goog