lkml.org 
[lkml]   [2019]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] gnss: core: added logging statement when kfifo_alloc fails
From
Date
On Tue, 2019-07-09 at 19:59 -0400, Keyur Patel wrote:
> Added missing logging statement when kfifo_alloc fails, to improve
> debugging.
[]
> Changes in v2:
> - fixed braces
[]
> diff --git a/drivers/gnss/core.c b/drivers/gnss/core.c
[]
> @@ -255,8 +255,10 @@ struct gnss_device *gnss_allocate_device(struct device *parent)
> init_waitqueue_head(&gdev->read_queue);
>
> ret = kfifo_alloc(&gdev->read_fifo, GNSS_READ_FIFO_SIZE, GFP_KERNEL);
> - if (ret)
> + if (ret) {
> + pr_err("kfifo_alloc failed\n");
> goto err_put_device;
> + }

This isn't really necessary as kfifo_alloc just
calls kmalloc_array and without the __GFP_NOWARN
flag, already does a dump_stack()


\
 
 \ /
  Last update: 2019-07-11 10:27    [W:0.030 / U:37.536 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site