If this 'kzalloc()' fails we must free some resources as in all the other
error handling paths of this function.
Fixes:
2e2deee7618b ("net: hns3: add the RAS compatibility adaptation solution")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Jiaran Zhang <zhangjiaran@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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) {