OrangePi_CM5/drivers/net/ethernet/freescale/fman
Jiasheng Jiang f5e4f68d57 fsl/fman: Check for null pointer after calling devm_ioremap
[ Upstream commit d5a73ec96cc57cf67e51b12820fc2354e7ca46f8 ]

As the possible failure of the allocation, the devm_ioremap() may return
NULL pointer.
Take tgec_initialization() as an example.
If allocation fails, the params->base_addr will be NULL pointer and will
be assigned to tgec->regs in tgec_config().
Then it will cause the dereference of NULL pointer in set_mac_address(),
which is called by tgec_init().
Therefore, it should be better to add the sanity check after the calling
of the devm_ioremap().

Fixes: 3933961682 ("fsl/fman: Add FMan MAC driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-01-27 10:54:01 +01:00
..
Kconfig ethernet: select CONFIG_CRC32 as needed 2020-12-04 14:42:21 -08:00
Makefile
…
fman.c
…
fman.h
…
fman_dtsec.c
…
fman_dtsec.h
…
fman_keygen.c
…
fman_keygen.h
…
fman_mac.h
…
fman_memac.c
…
fman_memac.h
…
fman_muram.c
…
fman_muram.h
…
fman_port.c fsl/fman: Fix missing put_device() call in fman_port_probe 2022-01-05 12:40:32 +01:00
fman_port.h
…
fman_sp.c
…
fman_sp.h
…
fman_tgec.c
…
fman_tgec.h
…
mac.c fsl/fman: Check for null pointer after calling devm_ioremap 2022-01-27 10:54:01 +01:00
mac.h
…