lkml.org 
[lkml]   [2020]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4.19 47/48] i40e: Memory leak in i40e_config_iwarp_qvlist
Hi!

> From: Martyna Szapar <martyna.szapar@intel.com>
>
> [ Upstream commit 0b63644602cfcbac849f7ea49272a39e90fa95eb ]
>
> Added freeing the old allocation of vf->qvlist_info in function
> i40e_config_iwarp_qvlist before overwriting it with
> the new allocation.

Ok, but this also other error paths:

> --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
> @@ -449,16 +450,19 @@ static int i40e_config_iwarp_qvlist(stru
> "Incorrect number of iwarp vectors %u. Maximum %u allowed.\n",
> qvlist_info->num_vectors,
> msix_vf);
> - goto err;
> + ret = -EINVAL;
> + goto err_out;
> }

And it is no longer freeing data qvlist_info() in this path. Is that
correct? Should it goto err_free instead?

> @@ -512,10 +518,11 @@ static int i40e_config_iwarp_qvlist(stru
> }
>
> return 0;
> -err:
> +err_free:
> kfree(vf->qvlist_info);
> vf->qvlist_info = NULL;
> - return -EINVAL;
> +err_out:
> + return ret;
> }

Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-08-11 14:47    [W:0.313 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site