* [PATCH] ARM/mvebu: Fix possible null dereference in armada_375_380_coherency_init
@ 2021-11-15 10:51 yuuoniy
0 siblings, 0 replies; only message in thread
From: yuuoniy @ 2021-11-15 10:51 UTC (permalink / raw)
Cc: linmq006, Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Russell King, linux-arm-kernel, linux-kernel
Prevent potential when access p->name after unsuccessful allocation.
Signed-off-by: yuuoniy <linmq006@gmail.com>
---
arch/arm/mach-mvebu/coherency.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
index 49e3c8d20c2f..4fdb1fae63c5 100644
--- a/arch/arm/mach-mvebu/coherency.c
+++ b/arch/arm/mach-mvebu/coherency.c
@@ -194,6 +194,8 @@ static void __init armada_375_380_coherency_init(struct device_node *np)
struct property *p;
p = kzalloc(sizeof(*p), GFP_KERNEL);
+ if (!p)
+ return;
p->name = kstrdup("arm,io-coherent", GFP_KERNEL);
of_add_property(cache_dn, p);
}
--
2.17.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-15 10:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15 10:51 [PATCH] ARM/mvebu: Fix possible null dereference in armada_375_380_coherency_init yuuoniy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®