Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

firmware: google: fix a NULL vs IS_ERR() check in cbmem_entry_probe()

The devm_memremap() function returns error pointers on error,
it doesn't return NULL.

Fixes: 19d54020883c ("firmware: google: Implement cbmem in sysfs driver")
Signed-off-by: Peng Wu <wupeng58@huawei.com>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Link: https://lore.kernel.org/r/20221115091138.51614-1-wupeng58@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Peng Wu and committed by
Greg Kroah-Hartman
fa1ba41c ab760791

+2 -2
+2 -2
drivers/firmware/google/cbmem.c
··· 106 106 entry->mem_file_buf = devm_memremap(&dev->dev, dev->cbmem_entry.address, 107 107 dev->cbmem_entry.entry_size, 108 108 MEMREMAP_WB); 109 - if (!entry->mem_file_buf) 110 - return -ENOMEM; 109 + if (IS_ERR(entry->mem_file_buf)) 110 + return PTR_ERR(entry->mem_file_buf); 111 111 112 112 entry->size = dev->cbmem_entry.entry_size; 113 113