From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergey Matyukevich Subject: Re: [PATCH] qtnfmac: avoid uninitialized variable access Date: Tue, 9 Oct 2018 20:25:16 +0000 Message-ID: <20181009202507.xs5bcaq5pi4zcps3@bars> References: <20181009155757.494212-1-arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: Igor Mitsyanko , Igor Mitsyanko , Avinash Patil , Sergey Matyukevich , Kalle Valo , "David S. Miller" , Andrey Shevchenko , "linux-wireless@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" To: Arnd Bergmann Return-path: In-Reply-To: <20181009155757.494212-1-arnd@arndb.de> Content-Language: en-US Content-ID: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Hello Arnd, > When qtnf_trans_send_cmd_with_resp() fails, we have not yet initialized > 'resp', as pointed out by a valid gcc warning: >=20 > drivers/net/wireless/quantenna/qtnfmac/commands.c: In function 'qtnf_cmd_= send_with_reply': > drivers/net/wireless/quantenna/qtnfmac/commands.c:133:54: error: 'resp' m= ay be used uninitialized in this function [-Werror=3Dmaybe-uninitialized] >=20 > Since 'resp_skb' is also not set here, we can skip all further > processing and just print the warning and return the failure code. >=20 > Fixes: c6ed298ffe09 ("qtnfmac: cleanup and unify command error handling") > Signed-off-by: Arnd Bergmann Thanks for the patch! And for reminding me that I forgot to enable gcc warnings in CI builds in addition to sparse checks. Reviewed-by: Sergey Matyukevich Regards, Sergey