wifi: mt76: mt7921: resource leaks at mt7921_check_offload_capability()
Subsystems (2)
[email protected]
reviewerPATCH 1/1 wifi: mt76: mt7921: resource leaks at mt7921_check_offload_capability()
From: Sean Wang <[email protected]>
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]>
--- drivers/net/wireless/mediatek/mt76/mt7921/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7921/init.c +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 ;
Signature · 1 line
2.25.1
Il 09/12/22 00:01, [email protected] ha scritto:
Quoted 9 lines
From: Sean Wang <[email protected]>
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]>
Reviewed-by AngeloGioacchino Del Regno <[email protected]>