Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1726711

Re: [PATCH] connector: Delete an error message for a failed memory allocation in cn_queue_alloc_callback_entry()

From Evgeniy Polyakov <zbr@ioremap.net>
Newsgroups linux.kernel
Subject Re: [PATCH] connector: Delete an error message for a failed memory allocation in cn_queue_alloc_callback_entry()
Date 2017-09-05 15:20 +0200
Message-ID <umlVL-34Y-3@gated-at.bofh.it> (permalink)
References <ujbpT-3yh-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi everyone

27.08.2017, 22:25, "SF Markus Elfring" <elfring@users.sourceforge.net>:
> From: Markus Elfring <elfring@users.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.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Looks good to me, thanks Markus.
There is virtually zero useful information in this print if we are in the situation, when kernel can not allocate
a few bytes to run connector queue.

Acked-by: Evgeniy Polyakov <zbr@ioremap.net>

kernel-janitors@ please queue this patch up

> ---
>  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;
> - }
>
>          atomic_set(&cbq->refcnt, 1);
>
> --
> 2.14.1

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] connector: Delete an error message for a failed memory  allocation in cn_queue_alloc_callback_entry() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-27 21:30 +0200
  Re: [PATCH] connector: Delete an error message for a failed memory  allocation in cn_queue_alloc_callback_entry() "Waskiewicz Jr, Peter" <peter.waskiewicz.jr@intel.com> - 2017-08-28 01:20 +0200
    Re: [PATCH] connector: Delete an error message for a failed memory  allocation in cn_queue_alloc_callback_entry() Dan Carpenter <dan.carpenter@oracle.com> - 2017-08-28 08:10 +0200
      Re: [PATCH] connector: Delete an error message for a failed memory  allocation in cn_queue_alloc_callback_entry() "Waskiewicz Jr, Peter" <peter.waskiewicz.jr@intel.com> - 2017-08-28 16:10 +0200
    Re: connector: Delete an error message for a failed memory allocation  in cn_queue_alloc_callback_entry() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-28 09:10 +0200
  Re: [PATCH] connector: Delete an error message for a failed memory allocation in cn_queue_alloc_callback_entry() Evgeniy Polyakov <zbr@ioremap.net> - 2017-09-05 15:20 +0200

csiph-web