diff options
author | Ajay Singh <ajay.kathat@microchip.com> | 2018-09-04 09:39:19 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-10 18:17:38 +0300 |
commit | 19707ca2953b8190de4475f7c7c32949badee191 (patch) | |
tree | e3b2da1083e73242ef8e6f32396c6f81ab2126f4 | |
parent | 1803da60f7c208cb7138f289dfc6d05fe49e1bd3 (diff) | |
download | linux-19707ca2953b8190de4475f7c7c32949badee191.tar.xz |
staging: wilc1000: fix to use correct index to free scanned info in clear_shadow_scan()
Fixes to use correct index to free the allocated memory for ies
information. The check was done using 'last_scanned_cnt' index and its
not correct, so use the correct index ('i') to check for before freeing
the allocated memory.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index d853508daca2..ede9134722e3 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -165,9 +165,9 @@ static void clear_shadow_scan(void) return; for (i = 0; i < last_scanned_cnt; i++) { - if (last_scanned_shadow[last_scanned_cnt].ies) { + if (last_scanned_shadow[i].ies) { kfree(last_scanned_shadow[i].ies); - last_scanned_shadow[last_scanned_cnt].ies = NULL; + last_scanned_shadow[i].ies = NULL; } kfree(last_scanned_shadow[i].join_params); |