[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY4PR2101MB0867CEFAF4FB72AF47FA3AA7CA130@CY4PR2101MB0867.namprd21.prod.outlook.com>
Date: Mon, 8 Jan 2018 15:37:27 +0000
From: Haiyang Zhang <haiyangz@...rosoft.com>
To: SF Markus Elfring <elfring@...rs.sourceforge.net>,
"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
KY Srinivasan <kys@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>
CC: LKML <linux-kernel@...r.kernel.org>,
"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: RE: [PATCH] hyperv/netvsc: Delete two error messages for a failed
memory allocation in netvsc_init_buf()
> -----Original Message-----
> From: SF Markus Elfring [mailto:elfring@...rs.sourceforge.net]
> Sent: Sunday, January 7, 2018 3:10 PM
> To: devel@...uxdriverproject.org; netdev@...r.kernel.org; Haiyang Zhang
> <haiyangz@...rosoft.com>; KY Srinivasan <kys@...rosoft.com>; Stephen
> Hemminger <sthemmin@...rosoft.com>
> Cc: LKML <linux-kernel@...r.kernel.org>; kernel-janitors@...r.kernel.org
> Subject: [PATCH] hyperv/netvsc: Delete two error messages for a failed
> memory allocation in netvsc_init_buf()
>
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Sun, 7 Jan 2018 21:03:26 +0100
>
> Omit extra messages for a memory allocation failure in this function.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> ---
> drivers/net/hyperv/netvsc.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index
> 17e529af79dc..c1ec02f801f6 100644
> --- a/drivers/net/hyperv/netvsc.c
> +++ b/drivers/net/hyperv/netvsc.c
> @@ -275,9 +275,6 @@ static int netvsc_init_buf(struct hv_device *device,
>
> net_device->recv_buf = vzalloc(buf_size);
> if (!net_device->recv_buf) {
> - netdev_err(ndev,
> - "unable to allocate receive buffer of size %u\n",
> - buf_size);
> ret = -ENOMEM;
> goto cleanup;
> }
> @@ -357,8 +354,6 @@ static int netvsc_init_buf(struct hv_device *device,
>
> net_device->send_buf = vzalloc(buf_size);
> if (!net_device->send_buf) {
> - netdev_err(ndev, "unable to allocate send buffer of
> size %u\n",
> - buf_size);
> ret = -ENOMEM;
> goto cleanup;
> }
These messages are not displayed anywhere else:
"unable to allocate receive buffer of size %u\n"
"unable to allocate send buffer of size %u\n",
After set ret = -ENOMEM; and cleanup, we won't know which buffer allocation failed without the error message.
So please do not remove these messages.
Thanks,
- Haiyang
Powered by blists - more mailing lists