From: Li RongQing <lirongq...@baidu.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 <lirongq...@baidu.com> > Reviewed-by: Wang Li <wangl...@baidu.com> > --- > v1->v2: not call get_ethtool_stats if n_stats is 0 Applied and queued up for -stable, thanks.