projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
50d934c
)
memory: emif: check the pointer temp in get_device_details()
author
Jia-Ju Bai
<baijiaju1990@gmail.com>
Fri, 25 Feb 2022 13:25:52 +0000
(
05:25
-0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:20 +0000
(14:23 +0200)
[ Upstream commit
5b5ab1bfa1898c6d52936a57c25c5ceba2cb2f87
]
The pointer temp is allocated by devm_kzalloc(), so it should be
checked for error handling.
Fixes: 7ec944538dde ("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>
drivers/memory/emif.c
patch
|
blob
|
history
diff --git
a/drivers/memory/emif.c
b/drivers/memory/emif.c
index d4d4044e05b30e53aba4ff5b74feede780ef7cc8..ecc78d6f89ed2e3d598f3fb94cca2c070ceeb93b 100644
(file)
--- a/
drivers/memory/emif.c
+++ b/
drivers/memory/emif.c
@@
-1025,7
+1025,7
@@
static struct emif_data *__init_or_module get_device_details(
temp = devm_kzalloc(dev, sizeof(*pd), 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__);
goto error;
}