All of lore.kernel.org
 help / color / mirror / Atom feed
* [ath6kl:pending 144/144] drivers/net/wireless/ath/wcn36xx/testmode.c:122:5: warning: 'msg' may be used uninitialized in this function
@ 2018-05-18 17:16 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2018-05-18 17:16 UTC (permalink / raw)
  To: Eyal Ilsar; +Cc: Kalle Valo, Ramon Fried, kbuild-all, ath10k

[-- Attachment #1: Type: text/plain, Size: 3911 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git pending
head:   f39910e66f150e60eaceb8a61a59e2d289e0b881
commit: f39910e66f150e60eaceb8a61a59e2d289e0b881 [144/144] wcn36xx: Add support for Factory Test Mode (FTM)
config: i386-randconfig-x017-201819 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        git checkout f39910e66f150e60eaceb8a61a59e2d289e0b881
        # save the attached .config to linux build tree
        make ARCH=i386 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/net/wireless/ath/wcn36xx/testmode.c: In function 'wcn36xx_tm_cmd':
>> drivers/net/wireless/ath/wcn36xx/testmode.c:122:5: warning: 'msg' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (rsp != msg)
        ^
   drivers/net/wireless/ath/wcn36xx/testmode.c:48:22: note: 'msg' was declared here
     struct ftm_rsp_msg *msg, *rsp = NULL;
                         ^~~

vim +/msg +122 drivers/net/wireless/ath/wcn36xx/testmode.c

    42	
    43	static int wcn36xx_tm_cmd_ptt(struct wcn36xx *wcn, struct ieee80211_vif *vif,
    44				      struct nlattr *tb[])
    45	{
    46		int ret = 0, buf_len;
    47		void *buf;
    48		struct ftm_rsp_msg *msg, *rsp = NULL;
    49		struct sk_buff *skb;
    50	
    51		if (!tb[WCN36XX_TM_ATTR_DATA]) {
    52			ret = -EINVAL;
    53			goto out;
    54		}
    55	
    56		buf = nla_data(tb[WCN36XX_TM_ATTR_DATA]);
    57		buf_len = nla_len(tb[WCN36XX_TM_ATTR_DATA]);
    58		msg = (struct ftm_rsp_msg *)buf;
    59	
    60		wcn36xx_dbg(WCN36XX_DBG_TESTMODE,
    61			    "testmode cmd wmi msg_id 0x%04X msg_len %d buf %pK buf_len %d\n",
    62			   msg->msg_id, msg->msg_body_length,
    63			   buf, buf_len);
    64	
    65		wcn36xx_dbg_dump(WCN36XX_DBG_TESTMODE_DUMP, "REQ ", buf, buf_len);
    66	
    67		if (msg->msg_id == MSG_GET_BUILD_RELEASE_NUMBER) {
    68			struct build_release_number *body =
    69					(struct build_release_number *)
    70					msg->msg_response;
    71	
    72			body->drv_major = wcn->fw_major;
    73			body->drv_minor = wcn->fw_minor;
    74			body->drv_patch = wcn->fw_version;
    75			body->drv_build = wcn->fw_revision;
    76			body->ptt_max = 10;
    77			body->ptt_min = 0;
    78	
    79			rsp = msg;
    80			rsp->resp_status = 0;
    81		} else {
    82			wcn36xx_dbg(WCN36XX_DBG_TESTMODE,
    83				    "PPT Request >> HAL size %d\n",
    84					msg->msg_body_length);
    85	
    86			msg->resp_status = wcn36xx_smd_process_ptt_msg(wcn, vif, msg,
    87								       msg->msg_body_length, (void *)(&rsp));
    88	
    89			wcn36xx_dbg(WCN36XX_DBG_TESTMODE,
    90				    "Response status = %d\n",
    91					msg->resp_status);
    92			if (rsp)
    93				wcn36xx_dbg(WCN36XX_DBG_TESTMODE,
    94					    "PPT Response << HAL size %d\n",
    95						rsp->msg_body_length);
    96		}
    97	
    98		if (!rsp) {
    99			rsp = msg;
   100			wcn36xx_warn("No response! Echoing request with response status %d\n",
   101				     rsp->resp_status);
   102		}
   103		wcn36xx_dbg_dump(WCN36XX_DBG_TESTMODE_DUMP, "RSP ",
   104				 rsp, rsp->msg_body_length);
   105	
   106		skb = cfg80211_testmode_alloc_reply_skb(wcn->hw->wiphy,
   107							nla_total_size(msg->msg_body_length));
   108		if (!skb) {
   109			ret = -ENOMEM;
   110			goto out;
   111		}
   112	
   113		ret = nla_put(skb, WCN36XX_TM_ATTR_DATA, rsp->msg_body_length, rsp);
   114		if (ret) {
   115			kfree_skb(skb);
   116			goto out;
   117		}
   118	
   119		ret = cfg80211_testmode_reply(skb);
   120	
   121	out:
 > 122		if (rsp != msg)
   123			kfree(rsp);
   124	
   125		return ret;
   126	}
   127	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31712 bytes --]

[-- Attachment #3: Type: text/plain, Size: 146 bytes --]

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-05-18 17:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-18 17:16 [ath6kl:pending 144/144] drivers/net/wireless/ath/wcn36xx/testmode.c:122:5: warning: 'msg' may be used uninitialized in this function kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.