[bug report] mt76: add driver code for MT76x2e
From: Dan Carpenter <hidden>
Date: 2017-12-14 08:09:06
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