]> git.baikalelectronics.ru Git - kernel.git/commit
nvmem: brcm_nvram: Add check for kzalloc
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Fri, 27 Jan 2023 10:40:06 +0000 (10:40 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2023 10:28:19 +0000 (11:28 +0100)
commitd01eeebc742cc19999816ec7b6bedc7d075b9820
tree40ab67925efb6e6199099150066888c29ea08054
parent8ef3931d52360c65403471c2e50657c7847feaf6
nvmem: brcm_nvram: Add check for kzalloc

commit b0576ade3aaf24b376ea1a4406ae138e2a22b0c0 upstream.

Add the check for the return value of kzalloc in order to avoid
NULL pointer dereference.

Fixes: f45130fa14f0 ("nvmem: brcm_nvram: parse NVRAM content into NVMEM cells")
Cc: stable@vger.kernel.org
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230127104015.23839-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/brcm_nvram.c