wlan: sc2331: Fix to return error on timeout 95/233695/1 accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix tizen_6.0 tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.103124 accepted/tizen/6.0/unified/20211029.081326 accepted/tizen/6.0/unified/hotfix/20201103.045618 accepted/tizen/unified/20200528.132935 submit/tizen/20200526.073613 submit/tizen_6.0/20201029.205505 submit/tizen_6.0/20211029.144301 submit/tizen_6.0_hotfix/20201102.192905 submit/tizen_6.0_hotfix/20201103.115105 tizen_6.0.m2_release
authorSemun Lee <semun.lee@samsung.com>
Mon, 18 May 2020 08:51:47 +0000 (17:51 +0900)
committerSemun Lee <semun.lee@samsung.com>
Mon, 18 May 2020 08:51:47 +0000 (17:51 +0900)
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 <semun.lee@samsung.com>
drivers/net/wireless/sc2331/wlan_cfg80211.c
drivers/net/wireless/sc2331/wlan_cmd.c

index adf3ca9..86a7bcc 100644 (file)
@@ -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)
index c7ece53..c2aebb6 100644 (file)
@@ -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)) {