From: Semun Lee Date: Mon, 18 May 2020 08:51:47 +0000 (+0900) Subject: wlan: sc2331: Fix to return error on timeout X-Git-Tag: submit/tizen/20200526.073613^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_6.0;p=profile%2Fmobile%2Fplatform%2Fkernel%2Flinux-3.10-sc7730.git wlan: sc2331: Fix to return error on timeout When nl80211 command timed out, the driver should return error. The state of data structure in the driver should be updated only when it succeed. Change-Id: I31e3440e442531eb6136d09e5bb8069c1da09daf Signed-off-by: Semun Lee --- diff --git a/drivers/net/wireless/sc2331/wlan_cfg80211.c b/drivers/net/wireless/sc2331/wlan_cfg80211.c index adf3ca92..86a7bcc0 100644 --- a/drivers/net/wireless/sc2331/wlan_cfg80211.c +++ b/drivers/net/wireless/sc2331/wlan_cfg80211.c @@ -2722,13 +2722,10 @@ static int itm_wlan_change_mode(wlan_vif_t *vif, enum nl80211_iftype type) printkd("invalid interface type %u\n", type); return -EOPNOTSUPP; } - vif->wdev.iftype = type; if (mode == vif->mode) { printkd("not need change mode\n"); return 0; } - vif->wdev.iftype = type; - vif->mode = mode; printkd("[%s][%d][%d]\n", __func__, vif_id, mode); ret = wlan_cmd_mac_open(vif_id, mode, vif->ndev->dev_addr); if (OK != ret) diff --git a/drivers/net/wireless/sc2331/wlan_cmd.c b/drivers/net/wireless/sc2331/wlan_cmd.c index c7ece533..c2aebb60 100644 --- a/drivers/net/wireless/sc2331/wlan_cmd.c +++ b/drivers/net/wireless/sc2331/wlan_cmd.c @@ -278,6 +278,8 @@ int wlan_cmd_send_recv(unsigned char vif_id, unsigned char *pData, int len, if (-1 == ret) { printke("[SEND_CMD %s %d ERROR][rsp timeout]\n", get_cmd_name(subtype), vif_id); + wlan_cmd_unlock(cmd); + goto ERR; } if ((SC2331_HOST_RSP != msg->type) || (subtype != msg->subtype)) {