mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7921: resource leaks at mt7921_check_offload_capability()
Fixed coverity issue with resource leaks at variable "fw" going out of scope leaks the storage it points to mt7921_check_offload_capability(). Reported-by: coverity-bot <[email protected]> Addresses-Coverity-ID: 1527806 ("Resource leaks") Fixes: 034ae28b56f1 ("wifi: mt76: mt7921: introduce remain_on_channel support") Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+2
-1
@@ -175,7 +175,7 @@ u8 mt7921_check_offload_capability(struct device *dev, const char *fw_wm)
|
||||
|
||||
if (!fw || !fw->data || fw->size < sizeof(*hdr)) {
|
||||
dev_err(dev, "Invalid firmware\n");
|
||||
return -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
data = fw->data;
|
||||
@@ -206,6 +206,7 @@ u8 mt7921_check_offload_capability(struct device *dev, const char *fw_wm)
|
||||
data += le16_to_cpu(rel_info->len) + rel_info->pad_len;
|
||||
}
|
||||
|
||||
out:
|
||||
release_firmware(fw);
|
||||
|
||||
return features ? features->data : 0;
|
||||
|
||||
Reference in New Issue
Block a user