答复: 答复: [PATCH] net: ethtool: not call vzalloc for zero sized memory request

2019-03-28 Thread Li,Rongqing
> -邮件原件- > 发件人: Michal Kubecek [mailto:mkube...@suse.cz] > 发送时间: 2019年3月28日 18:26 > 收件人: Li,Rongqing > 抄送: netdev@vger.kernel.org > 主题: Re: 答复: [PATCH] net: ethtool: not call vzalloc for zero sized memory > request > > On Thu, Mar 28, 2019 at 09:51:56

Re: 答复: [PATCH] net: ethtool: not call vzalloc for zero sized memory request

2019-03-28 Thread Michal Kubecek
On Thu, Mar 28, 2019 at 09:51:56AM +, Li,Rongqing wrote: > > -邮件原件- > > 发件人: Michal Kubecek [mailto:mkube...@suse.cz] > > 发送时间: 2019年3月28日 17:09 > > 收件人: Li,Rongqing > > 抄送: netdev@vger.kernel.org > > 主题: Re: [PATCH] net: ethtool: not call v

答复: [PATCH] net: ethtool: not call vzalloc for zero sized memory request

2019-03-28 Thread Li,Rongqing
> -邮件原件- > 发件人: Michal Kubecek [mailto:mkube...@suse.cz] > 发送时间: 2019年3月28日 17:09 > 收件人: Li,Rongqing > 抄送: netdev@vger.kernel.org > 主题: Re: [PATCH] net: ethtool: not call vzalloc for zero sized memory request > > On Thu, Mar 28, 2019 at 02:01:09PM +0800, Li Ron

Re: [PATCH] net: ethtool: not call vzalloc for zero sized memory request

2019-03-28 Thread Michal Kubecek
On Thu, Mar 28, 2019 at 02:01:09PM +0800, Li RongQing wrote: > 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 __ethtool_get_strings which alwa

[PATCH] net: ethtool: not call vzalloc for zero sized memory request

2019-03-27 Thread Li RongQing
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 __ethtool_get_strings which always uses the allocated memory this also fixes a possible memory leak if