Skip to content

Commit a222fd8

Browse files
JiangJiasLi Yang
authored andcommitted
soc: fsl: qe: Check of ioremap return value
As the possible failure of the ioremap(), the par_io could be NULL. Therefore it should be better to check it and return error in order to guarantee the success of the initiation. But, I also notice that all the caller like mpc85xx_qe_par_io_init() in `arch/powerpc/platforms/85xx/common.c` don't check the return value of the par_io_init(). Actually, par_io_init() needs to check to handle the potential error. I will submit another patch to fix that. Anyway, par_io_init() itsely should be fixed. Fixes: 7aa1aa6 ("QE: Move QE from arch/powerpc to drivers/soc") Signed-off-by: Jiasheng Jiang <[email protected]> Signed-off-by: Li Yang <[email protected]>
1 parent 6385960 commit a222fd8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/soc/fsl/qe/qe_io.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ int par_io_init(struct device_node *np)
3535
if (ret)
3636
return ret;
3737
par_io = ioremap(res.start, resource_size(&res));
38+
if (!par_io)
39+
return -ENOMEM;
3840

3941
if (!of_property_read_u32(np, "num-ports", &num_ports))
4042
num_par_io_ports = num_ports;

0 commit comments

Comments
 (0)