]> git.baikalelectronics.ru Git - kernel.git/commit
net: ll_temac: check the return value of devm_kmalloc()
authorXiaoke Wang <xkernel.wang@foxmail.com>
Fri, 18 Feb 2022 02:19:39 +0000 (10:19 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Feb 2022 12:00:44 +0000 (12:00 +0000)
commit12f21cd035bc1538b041949922c7059c72194c42
treeb690368eaf5e89449834e586359dc52e73cc4653
parent241a9950d11dcbe2e3bc12bdddbad12343fde29f
net: ll_temac: check the return value of devm_kmalloc()

devm_kmalloc() returns a pointer to allocated memory on success, NULL
on failure. While lp->indirect_lock is allocated by devm_kmalloc()
without proper check. It is better to check the value of it to
prevent potential wrong memory access.

Fixes: abb9098d3898 ("net: ll_temac: Support indirect_mutex share within TEMAC IP")
Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/xilinx/ll_temac_main.c