lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <E0D909EE5BB15A4699798539EA149D7F0779689E@ORSMSX103.amr.corp.intel.com>
Date:   Sun, 27 Aug 2017 23:16:06 +0000
From:   "Waskiewicz Jr, Peter" <peter.waskiewicz.jr@...el.com>
To:     SF Markus Elfring <elfring@...rs.sourceforge.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Evgeniy Polyakov <zbr@...emap.net>
CC:     LKML <linux-kernel@...r.kernel.org>,
        "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH] connector: Delete an error message for a failed memory
 allocation in cn_queue_alloc_callback_entry()

On 8/27/17 3:26 PM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Sun, 27 Aug 2017 21:18:37 +0200
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> This issue was detected by using the Coccinelle software.

Did coccinelle trip on the message or the fact you weren't returning NULL?

> 
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> ---
>   drivers/connector/cn_queue.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/connector/cn_queue.c b/drivers/connector/cn_queue.c
> index 1f8bf054d11c..e4f31d679f02 100644
> --- a/drivers/connector/cn_queue.c
> +++ b/drivers/connector/cn_queue.c
> @@ -40,10 +40,8 @@ cn_queue_alloc_callback_entry(struct cn_queue_dev *dev, const char *name,
>   	struct cn_callback_entry *cbq;
>   
>   	cbq = kzalloc(sizeof(*cbq), GFP_KERNEL);
> -	if (!cbq) {
> -		pr_err("Failed to create new callback queue.\n");
> +	if (!cbq)
>   		return NULL;
> -	}

Wny not:

	if (!cbq) {
		pr_err("Failed to create new callback queue.\n");
+		return NULL;
	}

>   
>   	atomic_set(&cbq->refcnt, 1);
>   
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ