Commit b40d7af7 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by David S. Miller

net: hns3: Fix a memory leak in an error handling path in 'hclge_handle_error_info_log()'

If this 'kzalloc()' fails we must free some resources as in all the other
error handling paths of this function.

Fixes: 2e2deee7 ("net: hns3: add the RAS compatibility adaptation solution")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarJiaran Zhang <zhangjiaran@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ebe9d9eb
......@@ -2330,8 +2330,10 @@ int hclge_handle_error_info_log(struct hnae3_ae_dev *ae_dev)
buf_size = buf_len / sizeof(u32);
desc_data = kzalloc(buf_len, GFP_KERNEL);
if (!desc_data)
return -ENOMEM;
if (!desc_data) {
ret = -ENOMEM;
goto err_desc;
}
buf = kzalloc(buf_len, GFP_KERNEL);
if (!buf) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment