aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000/host_interface.c
diff options
context:
space:
mode:
authorAjay Singh <ajay.kathat@microchip.com>2018-03-26 17:15:57 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-28 13:38:46 +0200
commit7ab3e668aa9c74fe63fd28d47178d27142cc520d (patch)
tree09cc919a04c0b9ed750701823a06aa18697116f1 /drivers/staging/wilc1000/host_interface.c
parentstaging: wilc1000: avoid 'NULL' pointer access in wilc_network_info_received() (diff)
downloadlinux-dev-7ab3e668aa9c74fe63fd28d47178d27142cc520d.tar.xz
linux-dev-7ab3e668aa9c74fe63fd28d47178d27142cc520d.zip
staging: wilc1000: free allocated memory in edit and add station functions
Added fix to free the allocated memory in case of failure to enqueue the command. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000/host_interface.c')
-rw-r--r--drivers/staging/wilc1000/host_interface.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 020baf15e02d..89972e86c709 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3721,8 +3721,10 @@ int wilc_add_station(struct wilc_vif *vif, struct add_sta_param *sta_param)
}
result = wilc_enqueue_cmd(&msg);
- if (result)
+ if (result) {
netdev_err(vif->ndev, "wilc_mq_send fail\n");
+ kfree(add_sta_info->rates);
+ }
return result;
}
@@ -3805,8 +3807,10 @@ int wilc_edit_station(struct wilc_vif *vif,
}
result = wilc_enqueue_cmd(&msg);
- if (result)
+ if (result) {
netdev_err(vif->ndev, "wilc_mq_send fail\n");
+ kfree(add_sta_info->rates);
+ }
return result;
}