diff options
author | Jiasheng Jiang <jiasheng@iscas.ac.cn> | 2022-01-06 18:04:10 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-01-06 13:51:05 +0000 |
commit | d5a73ec96cc57cf67e51b12820fc2354e7ca46f8 (patch) | |
tree | fa88f40d1b198efad5308451ca00a29909c029a8 /net/smc | |
parent | 43d012123122cc69feacab55b71369f386c19566 (diff) | |
download | linux-d5a73ec96cc57cf67e51b12820fc2354e7ca46f8.tar.gz linux-d5a73ec96cc57cf67e51b12820fc2354e7ca46f8.tar.bz2 linux-d5a73ec96cc57cf67e51b12820fc2354e7ca46f8.zip |
fsl/fman: Check for null pointer after calling devm_ioremap
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: 3933961682a3 ("fsl/fman: Add FMan MAC driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc')
0 files changed, 0 insertions, 0 deletions