mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7921: fix use after free in mt7921_acpi_read()
Don't dereference "sar_root" after it has been freed.
Fixes: f965333e491e ("mt76: mt7921: introduce ACPI SAR support")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
dee0a3cbfb
commit
9dd7be2c51
+4
-1
@@ -13,6 +13,7 @@ mt7921_acpi_read(struct mt7921_dev *dev, u8 *method, u8 **tbl, u32 *len)
|
||||
acpi_handle root, handle;
|
||||
acpi_status status;
|
||||
u32 i = 0;
|
||||
int ret;
|
||||
|
||||
root = ACPI_HANDLE(mdev->dev);
|
||||
if (!root)
|
||||
@@ -52,9 +53,11 @@ mt7921_acpi_read(struct mt7921_dev *dev, u8 *method, u8 **tbl, u32 *len)
|
||||
*(*tbl + i) = (u8)sar_unit->integer.value;
|
||||
}
|
||||
free:
|
||||
ret = (i == sar_root->package.count) ? 0 : -EINVAL;
|
||||
|
||||
kfree(sar_root);
|
||||
|
||||
return (i == sar_root->package.count) ? 0 : -EINVAL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* MTCL : Country List Table for 6G band */
|
||||
|
||||
Reference in New Issue
Block a user