]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
i40e: Fix of memory leak and integer truncation in i40e_virtchnl.c
authorMartyna Szapar <martyna.szapar@intel.com>
Mon, 15 Apr 2019 21:43:07 +0000 (14:43 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 17:24:59 +0000 (18:24 +0100)
commit 24474f2709af6729b9b1da1c5e160ab62e25e3a4 upstream.

Fixed possible memory leak in i40e_vc_add_cloud_filter function:
cfilter is being allocated and in some error conditions
the function returns without freeing the memory.

Fix of integer truncation from u16 (type of queue_id value) to u8
when calling i40e_vc_isvalid_queue_id function.

Signed-off-by: Martyna Szapar <martyna.szapar@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
[bwh: Backported to 4.4: i40e_vc_add_cloud_filter() does not exist
 but the integer truncation is still possible]
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

index 18e10357f1d0bc253322ba49ef7cefa03d1d9363..b4b4d46da17342fff444c2d014aac82493c3938e 100644 (file)
@@ -188,7 +188,7 @@ static inline bool i40e_vc_isvalid_vsi_id(struct i40e_vf *vf, u16 vsi_id)
  * check for the valid queue id
  **/
 static inline bool i40e_vc_isvalid_queue_id(struct i40e_vf *vf, u16 vsi_id,
-                                           u8 qid)
+                                           u16 qid)
 {
        struct i40e_pf *pf = vf->pf;
        struct i40e_vsi *vsi = i40e_find_vsi_from_id(pf, vsi_id);