提交 fa1ba41c 编写于 作者: P Peng Wu 提交者: Greg Kroah-Hartman

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: 19d54020 ("firmware: google: Implement cbmem in sysfs driver")
Signed-off-by: NPeng Wu <wupeng58@huawei.com>
Reviewed-by: NGuenter Roeck <groeck@chromium.org>
Reviewed-by: NJack Rosenthal <jrosenth@chromium.org>
Link: https://lore.kernel.org/r/20221115091138.51614-1-wupeng58@huawei.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 ab760791
......@@ -106,8 +106,8 @@ static int cbmem_entry_probe(struct coreboot_device *dev)
entry->mem_file_buf = devm_memremap(&dev->dev, dev->cbmem_entry.address,
dev->cbmem_entry.entry_size,
MEMREMAP_WB);
if (!entry->mem_file_buf)
return -ENOMEM;
if (IS_ERR(entry->mem_file_buf))
return PTR_ERR(entry->mem_file_buf);
entry->size = dev->cbmem_entry.entry_size;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册