Commit 2278f0c3 authored by Hans de Goede's avatar Hans de Goede Committed by Greg Kroah-Hartman

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: default avatarHans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210217102501.31758-3-hdegoede@redhat.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bb6886bf
...@@ -1179,10 +1179,8 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3) ...@@ -1179,10 +1179,8 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3)
lis3->reg_cache = kzalloc(max(sizeof(lis3_wai8_regs), lis3->reg_cache = kzalloc(max(sizeof(lis3_wai8_regs),
sizeof(lis3_wai12_regs)), GFP_KERNEL); sizeof(lis3_wai12_regs)), GFP_KERNEL);
if (lis3->reg_cache == NULL) { if (lis3->reg_cache == NULL)
printk(KERN_ERR DRIVER_NAME "out of memory\n");
return -ENOMEM; return -ENOMEM;
}
mutex_init(&lis3->mutex); mutex_init(&lis3->mutex);
atomic_set(&lis3->wake_thread, 0); atomic_set(&lis3->wake_thread, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment