gnss: core: added logging statement when kfifo_alloc fails
PATCH 1/1 gnss: core: added logging statement when kfifo_alloc fails
Added missing logging statement when kfifo_alloc fails, to improve debugging.
--- drivers/gnss/core.c | 1 + 1 file changed, 1 insertion(+)
drivers/gnss/core.c +1 -0
@@ -256,6 +256,7 @@ struct gnss_device *gnss_allocate_device(struct device *parent) ret =kfifo_alloc (&gdev->read_fifo,GNSS_READ_FIFO_SIZE ,GFP_KERNEL );if (ret) +pr_err ("kfifo_alloc failed\n" ); goto err_put_device; gdev->write_buf =kzalloc (GNSS_WRITE_BUF_SIZE ,GFP_KERNEL );
Signature · 1 line
2.22.0
Joe Perches
NAKQuoted 2 lines · Keyur Patel
Added missing logging statement when
kfifo_allocfails, to improve debugging.\
Nack
drivers/gnss/core.c
Quoted 1 line
drivers/gnss/core.c +0
-0
[]
drivers/gnss/core.c struct gnss_device *gnss_allocate_device(struct device *parent) · line 260
Quoted 6 lines
drivers/gnss/core.c +1
-0@@ -256,6 +256,7 @@ struct gnss_device *gnss_allocate_device(struct device *parent) ret =kfifo_alloc (&gdev->read_fifo,GNSS_READ_FIFO_SIZE ,GFP_KERNEL );if (ret) +pr_err ("kfifo_alloc failed\n" ); goto err_put_device;
c is not python.
This will not do what you might expect.
Quoted 1 line
drivers/gnss/core.c +0
-0gdev->write_buf =kzalloc (GNSS_WRITE_BUF_SIZE ,GFP_KERNEL );
PATCH v2 1/1 gnss: core: added logging statement when kfifo_alloc fails
Added missing logging statement when kfifo_alloc fails, to improve debugging.
---
Changes in v2:
- fixed braces
--- drivers/gnss/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gnss/core.c +3 -1
@@ -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; + } gdev->write_buf =kzalloc (GNSS_WRITE_BUF_SIZE ,GFP_KERNEL );if (!gdev->write_buf)
Signature · 1 line
2.22.0
Quoted 2 lines · Keyur Patel
Added missing logging statement when
kfifo_allocfails, to improve debugging.
[]
Quoted 2 lines
Changes in v2:
- fixed braces
[]
drivers/gnss/core.c
Quoted 1 line
drivers/gnss/core.c +0
-0
[]
drivers/gnss/core.c struct gnss_device *gnss_allocate_device(struct device *parent) · line 261
Quoted 9 lines
drivers/gnss/core.c +3
-1@@ -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()