Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1281689 > unrolled thread
| Started by | Colin King <colin.king@canonical.com> |
|---|---|
| First post | 2015-12-02 12:50 +0100 |
| Last post | 2015-12-11 12:20 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] brcmfmac: only lock and unlock fws if fws is not null Colin King <colin.king@canonical.com> - 2015-12-02 12:50 +0100
Re: [PATCH] brcmfmac: only lock and unlock fws if fws is not null Arend van Spriel <arend@broadcom.com> - 2015-12-02 14:10 +0100
Re: brcmfmac: only lock and unlock fws if fws is not null Kalle Valo <kvalo@codeaurora.org> - 2015-12-11 12:20 +0100
| From | Colin King <colin.king@canonical.com> |
|---|---|
| Date | 2015-12-02 12:50 +0100 |
| Subject | [PATCH] brcmfmac: only lock and unlock fws if fws is not null |
| Message-ID | <qBe53-6Dh-1@gated-at.bofh.it> |
From: Colin Ian King <colin.king@canonical.com>
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>
---
drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
index 086cac3..092f33f 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
+++ b/drivers/net/wireless/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;
}
--
2.6.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Arend van Spriel <arend@broadcom.com> |
|---|---|
| Date | 2015-12-02 14:10 +0100 |
| Message-ID | <qBfkt-7B5-7@gated-at.bofh.it> |
| In reply to | #1281689 |
On 12/02/2015 12:45 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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.
Acked-by: Arend van Spriel <arend@broadcom.com>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
> index 086cac3..092f33f 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c
> +++ b/drivers/net/wireless/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;
> }
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Kalle Valo <kvalo@codeaurora.org> |
|---|---|
| Date | 2015-12-11 12:20 +0100 |
| Subject | Re: brcmfmac: only lock and unlock fws if fws is not null |
| Message-ID | <qEtTY-3va-27@gated-at.bofh.it> |
| In reply to | #1281689 |
> From: Colin Ian King <colin.king@canonical.com> > > 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> Thanks, applied to wireless-drivers-next.git. Kalle Valo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web