diff options
author | Hans de Goede <hdegoede@redhat.com> | 2021-02-17 11:25:01 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-24 08:26:29 +0100 |
commit | 2278f0c385d88a3898d0e977d6e80e5d3d3d6020 (patch) | |
tree | 422377956400885e64987d02200d6536ede96baf /drivers/misc | |
parent | bb6886bf1e2bf49627a1c4ac5e615cfe518c827f (diff) |
misc: lis3lv02d: Do not log an error when kmalloc fails
Logging an error when kmalloc fails is not necessary (and in general
should be avoided) because the malloc failure will already complain
loudly itself.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210217102501.31758-3-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/lis3lv02d/lis3lv02d.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c index 22dacfaad02f..70c5bb1e6f49 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d.c +++ b/drivers/misc/lis3lv02d/lis3lv02d.c @@ -1179,10 +1179,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 == NULL) return -ENOMEM; - } mutex_init(&lis3->mutex); atomic_set(&lis3->wake_thread, 0); |