wifi: mt76: Add check for devm_kstrdup()

Add check for the return value of devm_kstrdup() in
mt76_get_of_data_from_mtd() to catch potential exception.

Fixes: e7a6a044f9b9 ("mt76: testmode: move mtd part to mt76_dev")
Cc: [email protected]
Signed-off-by: Haoxiang Li <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Haoxiang Li
2025-03-10 13:01:25 +01:00
committed by Felix Fietkau
parent 5eab65bb54
commit d6a197dbc9
+4
View File
@@ -95,6 +95,10 @@ int mt76_get_of_data_from_mtd(struct mt76_dev *dev, void *eep, int offset, int l
#ifdef CONFIG_NL80211_TESTMODE
dev->test_mtd.name = devm_kstrdup(dev->dev, part, GFP_KERNEL);
if (!dev->test_mtd.name) {
ret = -ENOMEM;
goto out_put_node;
}
dev->test_mtd.offset = offset;
#endif