ath11k: Handle errors if peer creation fails
authorAlex Dewar <alex.dewar90@gmail.com>
Sat, 7 Nov 2020 08:16:29 +0000 (10:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:53:06 +0000 (11:53 +0100)
commit00f7592609c98412cabdbc82fa7549f9fb077982
tree1690ce17e875949297c58398c25b86f720730757
parent468b3a1ab2877f44d67ad3ffe82f82acea96365b
ath11k: Handle errors if peer creation fails

[ Upstream commit c134d1f8c436d96b3f62896c630278e3ec001280 ]

ath11k_peer_create() is called without its return value being checked,
meaning errors will be unhandled. Add missing check and, as the mutex is
unconditionally unlocked on leaving this function, simplify the exit
path.

Addresses-Coverity-ID: 1497531 ("Code maintainability issues")
Fixes: 701e48a43e15 ("ath11k: add packet log support for QCA6390")
Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201004100218.311653-1-alex.dewar90@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath11k/mac.c