[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1520823814.928386766@decadent.org.uk>
Date: Mon, 12 Mar 2018 03:03:34 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, "Andi Kleen" <andi@...stfloor.org>,
"Kalle Valo" <kvalo@....qualcomm.com>,
"Andi Kleen" <ak@...ux.intel.com>
Subject: [PATCH 3.2 005/104] ath6kl: fix uninitialized variable in
ath6kl_sdio_enable_scatter()
3.2.101-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Andi Kleen <andi@...stfloor.org>
commit 527f6570300980251e818e80865b437eefb4e5d3 upstream.
gcc 4.8 warns
/backup/lsrc/git/linux-lto-2.6/drivers/net/wireless/ath/ath6kl/sdio.c:
In function 'ath6kl_sdio_enable_scatter':
/backup/lsrc/git/linux-lto-2.6/drivers/net/wireless/ath/ath6kl/sdio.c:748:16:
warning: 'ret' may be used uninitialized in this function
[-Wmaybe-uninitialized]
if (virt_scat || ret) {
^
The variable can indeed be uninitialized when the previous if branch is
skipped. I just set it to zero for now. I'm not fully sure the fix is
correct, maybe the || should be an && ?
Signed-off-by: Andi Kleen <ak@...ux.intel.com>
Signed-off-by: Kalle Valo <kvalo@....qualcomm.com>
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
drivers/net/wireless/ath/ath6kl/sdio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -670,7 +670,7 @@ static int ath6kl_sdio_enable_scatter(st
{
struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar);
struct htc_target *target = ar->htc_target;
- int ret;
+ int ret = 0;
bool virt_scat = false;
/* check if host supports scatter and it meets our requirements */
Powered by blists - more mailing lists