[ 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:
|
||
|---|---|---|
| .. | ||
| Kconfig | ||
| 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 | ||
| fman_port.h | ||
| fman_sp.c | ||
| fman_sp.h | ||
| fman_tgec.c | ||
| fman_tgec.h | ||
| mac.c | ||
| mac.h | ||