staging: wilc1000: changes logic when happened mq_send fail

This patch changes logic when happened mq_send fail.
The check as a result value that mq_send fail.
But, regardless of the result value then perform a semaphore up.
That is an occur that semaphore locking.
Add to 'else' routine and move to 'else' position a semaphore up.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Leo Kim 2016-04-01 17:44:13 +09:00 committed by Greg Kroah-Hartman
parent ae33a836df
commit 27e1f13964
1 changed files with 18 additions and 15 deletions

View File

@ -2731,6 +2731,7 @@ int wilc_remove_wep_key(struct wilc_vif *vif, u8 index)
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result)
netdev_err(vif->ndev, "Request to remove WEP key\n");
else
wait_for_completion(&hif_drv->comp_test_key_block);
return result;
@ -2759,6 +2760,7 @@ int wilc_set_wep_default_keyid(struct wilc_vif *vif, u8 index)
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result)
netdev_err(vif->ndev, "Default key index\n");
else
wait_for_completion(&hif_drv->comp_test_key_block);
return result;
@ -2828,6 +2830,7 @@ int wilc_add_wep_key_bss_ap(struct wilc_vif *vif, const u8 *key, u8 len,
if (result)
netdev_err(vif->ndev, "AP - WEP Key\n");
else
wait_for_completion(&hif_drv->comp_test_key_block);
return result;
@ -2883,7 +2886,7 @@ int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, u8 ptk_key_len,
if (result)
netdev_err(vif->ndev, "PTK Key\n");
else
wait_for_completion(&hif_drv->comp_test_key_block);
return result;
@ -2951,7 +2954,7 @@ int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len,
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result)
netdev_err(vif->ndev, "RX GTK\n");
else
wait_for_completion(&hif_drv->comp_test_key_block);
return result;
@ -3098,7 +3101,7 @@ int wilc_disconnect(struct wilc_vif *vif, u16 reason_code)
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result)
netdev_err(vif->ndev, "Failed to send message: disconnect\n");
else
wait_for_completion(&hif_drv->comp_test_disconn_block);
return result;
@ -3220,7 +3223,7 @@ s32 wilc_get_inactive_time(struct wilc_vif *vif, const u8 *mac,
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result)
netdev_err(vif->ndev, "Failed to send get host ch param\n");
else
wait_for_completion(&hif_drv->comp_inactive_time);
*pu32InactiveTime = inactive_time;
@ -3502,7 +3505,7 @@ int wilc_deinit(struct wilc_vif *vif)
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
if (result != 0)
netdev_err(vif->ndev, "deinit : Error(%d)\n", result);
else
wait_for_completion(&hif_thread_comp);
wilc_mq_destroy(&hif_msg_q);
@ -3882,7 +3885,7 @@ int wilc_del_allstation(struct wilc_vif *vif, u8 mac_addr[][ETH_ALEN])
if (result)
netdev_err(vif->ndev, "wilc_mq_send fail\n");
else
wait_for_completion(&hif_wait_response);
return result;