提交 d7ae2e7b 编写于 作者: W William Dean 提交者: Zheng Zengkai

parisc: Check the return value of ioremap() in lba_driver_probe()

stable inclusion
from stable-v5.10.137
commit fc3918d70bbe65c8b92c9dc9d742c4559ccd2dbe
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I60PLB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=fc3918d70bbe65c8b92c9dc9d742c4559ccd2dbe

--------------------------------

commit cf59f34d upstream.

The function ioremap() in lba_driver_probe() can fail, so
its return value should be checked.

Fixes: 4bdc0d67 ("remove ioremap_nocache and devm_ioremap_nocache")
Reported-by: NHacash Robot <hacashRobot@santino.com>
Signed-off-by: NWilliam Dean <williamsukatube@gmail.com>
Signed-off-by: NHelge Deller <deller@gmx.de>
Cc: <stable@vger.kernel.org> # v5.6+
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 33097895
...@@ -1476,9 +1476,13 @@ lba_driver_probe(struct parisc_device *dev) ...@@ -1476,9 +1476,13 @@ lba_driver_probe(struct parisc_device *dev)
u32 func_class; u32 func_class;
void *tmp_obj; void *tmp_obj;
char *version; char *version;
void __iomem *addr = ioremap(dev->hpa.start, 4096); void __iomem *addr;
int max; int max;
addr = ioremap(dev->hpa.start, 4096);
if (addr == NULL)
return -ENOMEM;
/* Read HW Rev First */ /* Read HW Rev First */
func_class = READ_REG32(addr + LBA_FCLASS); func_class = READ_REG32(addr + LBA_FCLASS);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册