mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: fix a possible NULL pointer dereference in mt76_testmode_dump
Fix a possible NULL pointer dereference in mt76_testmode_dump() since
nla_nest_start returns NULL in case of error
Fixes: f0efa8621550e ("mt76: add API for testmode support")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
37a1c7ed67
commit
8c7c1a207d
+6
-2
@@ -442,9 +442,13 @@ int mt76_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *msg,
|
||||
mutex_lock(&dev->mutex);
|
||||
|
||||
if (tb[MT76_TM_ATTR_STATS]) {
|
||||
err = -EINVAL;
|
||||
|
||||
a = nla_nest_start(msg, MT76_TM_ATTR_STATS);
|
||||
err = mt76_testmode_dump_stats(dev, msg);
|
||||
nla_nest_end(msg, a);
|
||||
if (a) {
|
||||
err = mt76_testmode_dump_stats(dev, msg);
|
||||
nla_nest_end(msg, a);
|
||||
}
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user