mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
i40e: Fix a potential NULL pointer dereference
commit 54902349ee upstream.
If 'kzalloc()' fails, a NULL pointer will be dereferenced.
Return an error code (-ENOMEM) instead.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
77440c3a37
commit
8f29881eb7
@@ -422,6 +422,9 @@ static int i40e_config_iwarp_qvlist(struct i40e_vf *vf,
|
||||
(sizeof(struct i40e_virtchnl_iwarp_qv_info) *
|
||||
(qvlist_info->num_vectors - 1));
|
||||
vf->qvlist_info = kzalloc(size, GFP_KERNEL);
|
||||
if (!vf->qvlist_info)
|
||||
return -ENOMEM;
|
||||
|
||||
vf->qvlist_info->num_vectors = qvlist_info->num_vectors;
|
||||
|
||||
msix_vf = pf->hw.func_caps.num_msix_vectors_vf;
|
||||
|
||||
Reference in New Issue
Block a user