[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190329.134240.2198417000673971691.davem@davemloft.net>
Date: Fri, 29 Mar 2019 13:42:40 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: lirongqing@...du.com
Cc: netdev@...r.kernel.org, mkubecek@...e.cz
Subject: Re: [PATCH][v2] net: ethtool: not call vzalloc for zero sized
memory request
From: Li RongQing <lirongqing@...du.com>
Date: Fri, 29 Mar 2019 09:18:02 +0800
> NULL or ZERO_SIZE_PTR will be returned for zero sized memory
> request, and derefencing them will lead to a segfault
>
> so it is unnecessory to call vzalloc for zero sized memory
> request and not call functions which maybe derefence the
> NULL allocated memory
>
> this also fixes a possible memory leak if phy_ethtool_get_stats
> returns error, memory should be freed before exit
>
> Signed-off-by: Li RongQing <lirongqing@...du.com>
> Reviewed-by: Wang Li <wangli39@...du.com>
> ---
> v1->v2: not call get_ethtool_stats if n_stats is 0
Applied and queued up for -stable, thanks.
Powered by blists - more mailing lists