summaryrefslogtreecommitdiff
path: root/net/tipc/socket.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-01-28 22:58:28 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-30 05:49:28 +0200
commit9a35bc2ae545b352966a107bf81d8fdcafe4d7bf (patch)
tree0888d904d9a81c2b961d4b39c63b553202f37115 /net/tipc/socket.c
parent58f80ccf09c4fb8ae2819cd2c0583b885b6b5454 (diff)
hostap: avoid uninitialized variable use in hfa384x_get_rid
commit 48dc5fb3ba53b20418de8514700f63d88c5de3a3 upstream. The driver reads a value from hfa384x_from_bap(), which may fail, and then assigns the value to a local variable. gcc detects that in in the failure case, the 'rlen' variable now contains uninitialized data: In file included from ../drivers/net/wireless/intersil/hostap/hostap_pci.c:220:0: drivers/net/wireless/intersil/hostap/hostap_hw.c: In function 'hfa384x_get_rid': drivers/net/wireless/intersil/hostap/hostap_hw.c:842:5: warning: 'rec' may be used uninitialized in this function [-Wmaybe-uninitialized] if (le16_to_cpu(rec.len) == 0) { This restructures the function as suggested by Russell King, to make it more readable and get more reliable error handling, by handling each failure mode using a goto. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/tipc/socket.c')
0 files changed, 0 insertions, 0 deletions