Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ab3e668 authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman
Browse files

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: default avatarAjay Singh <ajay.kathat@microchip.com>
Reviewed-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 25b95133
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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;
}