提交 8d5b5e6a 编写于 作者: A Ajay Singh 提交者: Greg Kroah-Hartman

staging: wilc1000: free allocated memory after processing wilc_send_config_pkt()

Free allocated memory after completing wilc_send_config_pkt() function.
Remove unncessary use of 'stamac' pointer in handle_get_inactive_time().
Signed-off-by: NAjay Singh <ajay.kathat@microchip.com>
Reviewed-by: NClaudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 c26bdea4
...@@ -1921,7 +1921,6 @@ static s32 handle_get_inactive_time(struct wilc_vif *vif, ...@@ -1921,7 +1921,6 @@ static s32 handle_get_inactive_time(struct wilc_vif *vif,
struct sta_inactive_t *hif_sta_inactive) struct sta_inactive_t *hif_sta_inactive)
{ {
s32 result = 0; s32 result = 0;
u8 *stamac;
struct wid wid; struct wid wid;
struct host_if_drv *hif_drv = vif->hif_drv; struct host_if_drv *hif_drv = vif->hif_drv;
...@@ -1932,11 +1931,11 @@ static s32 handle_get_inactive_time(struct wilc_vif *vif, ...@@ -1932,11 +1931,11 @@ static s32 handle_get_inactive_time(struct wilc_vif *vif,
if (!wid.val) if (!wid.val)
return -ENOMEM; return -ENOMEM;
stamac = wid.val; ether_addr_copy(wid.val, hif_sta_inactive->mac);
ether_addr_copy(stamac, hif_sta_inactive->mac);
result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
wilc_get_vif_idx(vif)); wilc_get_vif_idx(vif));
kfree(wid.val);
if (result) { if (result) {
netdev_err(vif->ndev, "Failed to SET inactive time\n"); netdev_err(vif->ndev, "Failed to SET inactive time\n");
...@@ -2237,6 +2236,7 @@ static int handle_remain_on_chan(struct wilc_vif *vif, ...@@ -2237,6 +2236,7 @@ static int handle_remain_on_chan(struct wilc_vif *vif,
result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
wilc_get_vif_idx(vif)); wilc_get_vif_idx(vif));
kfree(wid.val);
if (result != 0) if (result != 0)
netdev_err(vif->ndev, "Failed to set remain on channel\n"); netdev_err(vif->ndev, "Failed to set remain on channel\n");
...@@ -2281,6 +2281,7 @@ static int handle_register_frame(struct wilc_vif *vif, ...@@ -2281,6 +2281,7 @@ static int handle_register_frame(struct wilc_vif *vif,
result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
wilc_get_vif_idx(vif)); wilc_get_vif_idx(vif));
kfree(wid.val);
if (result) { if (result) {
netdev_err(vif->ndev, "Failed to frame register\n"); netdev_err(vif->ndev, "Failed to frame register\n");
result = -EINVAL; result = -EINVAL;
...@@ -2312,6 +2313,7 @@ static u32 handle_listen_state_expired(struct wilc_vif *vif, ...@@ -2312,6 +2313,7 @@ static u32 handle_listen_state_expired(struct wilc_vif *vif,
result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
wilc_get_vif_idx(vif)); wilc_get_vif_idx(vif));
kfree(wid.val);
if (result != 0) { if (result != 0) {
netdev_err(vif->ndev, "Failed to set remain channel\n"); netdev_err(vif->ndev, "Failed to set remain channel\n");
goto _done_; goto _done_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册