* [PATCH] misc/lis3lv02d: Delete an error message for a failed memory allocation in lis3lv02d_init_device()
@ 2018-01-08 21:33 SF Markus Elfring
2018-01-09 8:11 ` Éric Piel
0 siblings, 1 reply; 3+ messages in thread
From: SF Markus Elfring @ 2018-01-08 21:33 UTC (permalink / raw)
To: kernel-janitors, Arnd Bergmann, Eric Piel, Greg Kroah-Hartman; +Cc: LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 8 Jan 2018 22:26:06 +0100
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>
---
drivers/misc/lis3lv02d/lis3lv02d.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c
index e49888eab87d..ba2bd49c15fa 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d.c
@@ -1172,11 +1172,8 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3)
lis3->reg_cache = kzalloc(max(sizeof(lis3_wai8_regs),
sizeof(lis3_wai12_regs)), GFP_KERNEL);
-
- if (lis3->reg_cache == NULL) {
- printk(KERN_ERR DRIVER_NAME "out of memory\n");
+ if (!lis3->reg_cache)
return -ENOMEM;
- }
mutex_init(&lis3->mutex);
atomic_set(&lis3->wake_thread, 0);
--
2.15.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] misc/lis3lv02d: Delete an error message for a failed memory allocation in lis3lv02d_init_device()
2018-01-08 21:33 [PATCH] misc/lis3lv02d: Delete an error message for a failed memory allocation in lis3lv02d_init_device() SF Markus Elfring
@ 2018-01-09 8:11 ` Éric Piel
2018-01-09 10:55 ` Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: Éric Piel @ 2018-01-09 8:11 UTC (permalink / raw)
To: SF Markus Elfring, kernel-janitors, Arnd Bergmann, Greg Kroah-Hartman
Cc: LKML
On 08/01/18 22:33, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 8 Jan 2018 22:26:06 +0100
>
> 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>
Thanks, looks fine.
Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
Maybe the "Kernel Janitors" can just pick it up?
Cheers,
Éric
> ---
> drivers/misc/lis3lv02d/lis3lv02d.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c
> index e49888eab87d..ba2bd49c15fa 100644
> --- a/drivers/misc/lis3lv02d/lis3lv02d.c
> +++ b/drivers/misc/lis3lv02d/lis3lv02d.c
> @@ -1172,11 +1172,8 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3)
>
> lis3->reg_cache = kzalloc(max(sizeof(lis3_wai8_regs),
> sizeof(lis3_wai12_regs)), GFP_KERNEL);
> -
> - if (lis3->reg_cache == NULL) {
> - printk(KERN_ERR DRIVER_NAME "out of memory\n");
> + if (!lis3->reg_cache)
> return -ENOMEM;
> - }
>
> mutex_init(&lis3->mutex);
> atomic_set(&lis3->wake_thread, 0);
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] misc/lis3lv02d: Delete an error message for a failed memory allocation in lis3lv02d_init_device()
2018-01-09 8:11 ` Éric Piel
@ 2018-01-09 10:55 ` Dan Carpenter
0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2018-01-09 10:55 UTC (permalink / raw)
To: Éric Piel
Cc: SF Markus Elfring, kernel-janitors, Arnd Bergmann,
Greg Kroah-Hartman, LKML
On Tue, Jan 09, 2018 at 09:11:51AM +0100, Éric Piel wrote:
> On 08/01/18 22:33, SF Markus Elfring wrote:
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > Date: Mon, 8 Jan 2018 22:26:06 +0100
> >
> > 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>
> Thanks, looks fine.
>
> Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net>
>
> Maybe the "Kernel Janitors" can just pick it up?
>
Kernel Janitors basically just reviews patches. (Although I don't
review Markus's patches any more).
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-09 10:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-08 21:33 [PATCH] misc/lis3lv02d: Delete an error message for a failed memory allocation in lis3lv02d_init_device() SF Markus Elfring
2018-01-09 8:11 ` Éric Piel
2018-01-09 10:55 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®