Message ID | 1620472165-7960-1-git-send-email-wangyunjian@huawei.com |
---|---|
State | New |
Headers | show |
Series | [net] iwlwifi: pnvm: fix resource leaks in iwl_pnvm_get_from_fs | expand |
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c index 40f2109a097f..d4ac83848926 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c @@ -322,10 +322,13 @@ static int iwl_pnvm_get_from_fs(struct iwl_trans *trans, u8 **data, size_t *len) } *data = kmemdup(pnvm->data, pnvm->size, GFP_KERNEL); - if (!*data) + if (!*data) { + release_firmware(pnvm); return -ENOMEM; + } *len = pnvm->size; + release_firmware(pnvm); return 0; }