Skip to content

Commit 5403a38

Browse files
XidianGeneralgregkh
authored andcommitted
memory: emif: check the pointer temp in get_device_details()
[ Upstream commit 5b5ab1b ] The pointer temp is allocated by devm_kzalloc(), so it should be checked for error handling. Fixes: 7ec9445 ("memory: emif: add basic infrastructure for EMIF driver") Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Link: https://lore.kernel.org/r/20220225132552.27894-1-baijiaju1990@gmail.com Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent e7d2e6e commit 5403a38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/memory/emif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ static struct emif_data *__init_or_module get_device_details(
10251025
temp = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
10261026
dev_info = devm_kzalloc(dev, sizeof(*dev_info), GFP_KERNEL);
10271027

1028-
if (!emif || !pd || !dev_info) {
1028+
if (!emif || !temp || !dev_info) {
10291029
dev_err(dev, "%s:%d: allocation error\n", __func__, __LINE__);
10301030
goto error;
10311031
}

0 commit comments

Comments
 (0)