Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd5dda43 authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Greg Kroah-Hartman
Browse files

memory: emif: check the pointer temp in get_device_details()



[ Upstream commit 5b5ab1bfa1898c6d52936a57c25c5ceba2cb2f87 ]

The pointer temp is allocated by devm_kzalloc(), so it should be
checked for error handling.

Fixes: 7ec94453 ("memory: emif: add basic infrastructure for EMIF driver")
Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Link: https://lore.kernel.org/r/20220225132552.27894-1-baijiaju1990@gmail.com


Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0ead05f7
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1423,7 +1423,7 @@ static struct emif_data *__init_or_module get_device_details(
	temp	= devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
	temp	= devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
	dev_info = devm_kzalloc(dev, sizeof(*dev_info), GFP_KERNEL);
	dev_info = devm_kzalloc(dev, sizeof(*dev_info), GFP_KERNEL);


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