From: greearb@candelatech.com
To: linux-wireless@vger.kernel.org
Cc: Ben Greear <greearb@candelatech.com>
Subject: [PATCH v3 02/11] mt76 - mt7915: Fix potential NPE in TXS processing.
Date: Fri, 23 Jul 2021 09:06:14 -0700 [thread overview]
Message-ID: <20210723160623.14709-2-greearb@candelatech.com> (raw)
In-Reply-To: <20210723160623.14709-1-greearb@candelatech.com>
From: Ben Greear <greearb@candelatech.com>
If skb is null, then don't try to dereference it.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
index 35e4b57bd133..3f4e19358d5b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
@@ -1321,7 +1321,7 @@ mt7915_mac_add_txs_skb(struct mt7915_dev *dev, struct mt76_wcid *wcid, int pid,
/* TODO: Gather stats anyway, even if we are not matching on an skb. */
if (!skb)
- goto out;
+ goto out_no_skb;
txs = le32_to_cpu(txs_data[0]);
txs5 = le32_to_cpu(txs_data[5]);
@@ -1434,6 +1434,8 @@ mt7915_mac_add_txs_skb(struct mt7915_dev *dev, struct mt76_wcid *wcid, int pid,
out:
mt76_tx_status_skb_done(mdev, skb, &list, wcid);
+
+out_no_skb:
mt76_tx_status_unlock(mdev, &list);
return !!skb;
--
2.20.1
next prev parent reply other threads:[~2021-07-23 16:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-23 16:06 [PATCH v3 01/11] mt76: add hash lookup for skb on TXS status_list greearb
2021-07-23 16:06 ` greearb [this message]
2021-07-23 16:06 ` [PATCH v3 03/11] mt76 - mt7915: Move TXS parsing to its own method greearb
2021-07-23 16:06 ` [PATCH v3 04/11] mt76 - mt7915: Allow processing TXS for 'NO_SKB' pkt-ids greearb
2021-07-23 16:06 ` [PATCH v3 05/11] mt76: mt7915: debugfs hook to enable TXS for NO_SKB pkt-ids greearb
2021-07-23 16:06 ` [PATCH v3 06/11] mt76: mt7915: Support parsing TXSFM 0x2 greearb
2021-07-23 16:06 ` [PATCH v3 07/11] mt76: mt7915: Add support for tx-overrides greearb
2021-07-23 16:06 ` [PATCH v3 08/11] mt76: mt7915: Fix SGI reporting when using tx-overrides greearb
2021-07-23 16:06 ` [PATCH v3 09/11] mt76: mt7915: txfree status to show txcount instead of latency greearb
2021-07-23 16:06 ` [PATCH v3 10/11] mt76: mt7915: Report tx-retries greearb
2021-07-23 16:06 ` [PATCH v3 11/11] mt76: mt7915: add a missing HT flag for GI parsing greearb
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210723160623.14709-2-greearb@candelatech.com \
--to=greearb@candelatech.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).