Commit b513cac2 authored by Colin Ian King's avatar Colin Ian King Committed by Kalle Valo
Browse files

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: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 133b7326
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1609,10 +1609,11 @@ static int brcmf_fws_notify_bcmc_credit_support(struct brcmf_if *ifp,
{
	struct brcmf_fws_info *fws = ifp->drvr->fws;

	if (fws) {
		brcmf_fws_lock(fws);
	if (fws)
		fws->bcmc_credit_check = true;
		brcmf_fws_unlock(fws);
	}
	return 0;
}