From: Dan Carpenter <dan.carpenter@oracle.com>
To: nbd@nbd.name
Cc: linux-wireless@vger.kernel.org
Subject: [bug report] mt76: add driver code for MT76x2e
Date: Thu, 14 Dec 2017 11:02:37 +0300 [thread overview]
Message-ID: <20171214080237.x3eiqxafn2kjfwor@mwanda> (raw)
Hello Felix Fietkau,
This is a semi-automatic email about new static checker warnings.
The patch 7bc04215a66b: "mt76: add driver code for MT76x2e" from Nov
21, 2017, leads to the following Smatch complaint:
drivers/net/wireless/mediatek/mt76/mt76x2_main.c:457 mt76x2_ampdu_action()
warn: variable dereferenced before check 'txq' (see line 453)
drivers/net/wireless/mediatek/mt76/mt76x2_main.c
452 struct ieee80211_txq *txq = sta->txq[params->tid];
453 struct mt76_txq *mtxq = (struct mt76_txq *) txq->drv_priv;
^^^^^^^^^^^^^
Unchecked dereference. Also the cast is has a checkpatch a space issue.
No space after the cast, because casting is a high precedence operation.
454 u16 tid = params->tid;
455 u16 *ssn = ¶ms->ssn;
456
457 if (!txq)
^^^
Check is too late.
458 return -EINVAL;
459
regards,
dan carpenter
next reply other threads:[~2017-12-14 8:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-14 8:02 Dan Carpenter [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-12-14 8:02 [bug report] mt76: add driver code for MT76x2e Dan Carpenter
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=20171214080237.x3eiqxafn2kjfwor@mwanda \
--to=dan.carpenter@oracle.com \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@nbd.name \
/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