Files
linux/net/core
Li RongQing 277604db44 net: ethtool: not call vzalloc for zero sized memory request
[ Upstream commit 3d8830266f ]

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@baidu.com>
Reviewed-by: Wang Li <wangli39@baidu.com>
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-15 12:22:39 +09:00
..
2018-01-31 14:13:00 +01:00
2015-04-02 14:04:59 -04:00
2015-11-22 11:54:10 -05:00
2018-01-17 10:29:45 +01:00
2015-10-26 22:24:22 -07:00