ath6kl: fix uninitialized variable in ath6kl_sdio_enable_scatter()
authorAndi Kleen <andi@firstfloor.org>
Mon, 3 Sep 2012 20:15:36 +0000 (22:15 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 19 Mar 2018 18:58:21 +0000 (18:58 +0000)
commita2d4436a69c3570419680ee75b431d2d9af26254
tree42e0180ad39977225faca1919186ecdd3abe4a93
parent6fee38de5df30ffb0a5e707c5b1ee16bb35c669b
ath6kl: fix uninitialized variable in ath6kl_sdio_enable_scatter()

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@linux.intel.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/wireless/ath/ath6kl/sdio.c