staging: wlan-ng: fix exit return when sme->key_idx >= NUM_WEPKEYS
authorColin Ian King <colin.king@canonical.com>
Mon, 14 Oct 2019 11:02:01 +0000 (12:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Oct 2019 08:19:48 +0000 (09:19 +0100)
commitd07c028d2bc9bc092982d1e40bb78bfdc886c76c
treedfb352c13797e6ec34496e603f2c404477b8a6c5
parent4034a503058995e2adf03d27610e62f7c1bb3dab
staging: wlan-ng: fix exit return when sme->key_idx >= NUM_WEPKEYS

commit 153c5d8191c26165dbbd2646448ca7207f7796d0 upstream.

Currently the exit return path when sme->key_idx >= NUM_WEPKEYS is via
label 'exit' and this checks if result is non-zero, however result has
not been initialized and contains garbage.  Fix this by replacing the
goto with a return with the error code.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 0ca6d8e74489 ("Staging: wlan-ng: replace switch-case statements with macro")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20191014110201.9874-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/cfg80211.c