Function rtw_wx_set_enc_ext() dynamically allocates a temporary buffer that
is not freed in all error paths. Use a centralized exit path and make sure
that all memory is freed correctly. Detected by Coverity - CID 
1077712.
Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
                alg_name = "CCMP";
                break;
        default:
-               return -1;
+               ret = -1;
+               goto exit;
        }
 
        strncpy((char *)param->u.crypt.alg, alg_name, IEEE_CRYPT_ALG_NAME_LEN);
 
        ret =  wpa_set_encryption(dev, param, param_len);
 
+exit:
        kfree(param);
        return ret;
 }