diff options
author | Colin Ian King <colin.king@canonical.com> | 2015-12-02 11:45:10 +0000 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-12-11 13:14:10 +0200 |
commit | b513cac22ad6527bd85042766afa8eacf1adffbe (patch) | |
tree | a5faafa90485402b4d2faca288a9798a338a0816 /drivers/net/wireless | |
parent | 133b7326e96031e69fcfb42d6f3040b563ce6464 (diff) | |
download | op-kernel-dev-b513cac22ad6527bd85042766afa8eacf1adffbe.zip op-kernel-dev-b513cac22ad6527bd85042766afa8eacf1adffbe.tar.gz |
brcmfmac: only lock and unlock fws if fws is not null
There is a null ptr check for fws to set bcmc_credit_check, however,
there a lock and unlock on fws should only performed if fwts is
also not null to also avoid a potential null pointer deference.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c index ffdc7f8..e5f5fac 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c @@ -1609,10 +1609,11 @@ static int brcmf_fws_notify_bcmc_credit_support(struct brcmf_if *ifp, { struct brcmf_fws_info *fws = ifp->drvr->fws; - brcmf_fws_lock(fws); - if (fws) + if (fws) { + brcmf_fws_lock(fws); fws->bcmc_credit_check = true; - brcmf_fws_unlock(fws); + brcmf_fws_unlock(fws); + } return 0; } |