Commit 0a4ecc2c authored by Christophe Jaillet's avatar Christophe Jaillet Committed by Jeff Kirsher

i40e: Check for memory allocation failure

If 'kzalloc' fails, a NULL pointer will be dereferenced. Return -ENOMEM
instead.
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 0bc0706b
......@@ -595,6 +595,8 @@ static int i40e_client_setup_qvlist(struct i40e_info *ldev,
size = sizeof(struct i40e_qvlist_info) +
(sizeof(struct i40e_qv_info) * (qvlist_info->num_vectors - 1));
ldev->qvlist_info = kzalloc(size, GFP_KERNEL);
if (!ldev->qvlist_info)
return -ENOMEM;
ldev->qvlist_info->num_vectors = qvlist_info->num_vectors;
for (i = 0; i < qvlist_info->num_vectors; i++) {
......
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