mirror of
https://github.com/torvalds/linux.git
synced 2024-11-13 23:51:39 +00:00
soc: fsl: guts: check return value after calling of_iomap() in fsl_guts_get_soc_uid()
of_iomap() may return NULL, so we need check the return value. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Michael Walle <michael@walle.cc> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
This commit is contained in:
parent
edf12b913a
commit
63f9815307
@ -126,6 +126,10 @@ static u64 fsl_guts_get_soc_uid(const char *compat, unsigned int offset)
|
||||
return 0;
|
||||
|
||||
sfp_base = of_iomap(np, 0);
|
||||
if (!sfp_base) {
|
||||
of_node_put(np);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uid = ioread32(sfp_base + offset);
|
||||
uid <<= 32;
|
||||
|
Loading…
Reference in New Issue
Block a user