lkml.org 
[lkml]   [2021]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ARM/mvebu: Fix possible null dereference in armada_375_380_coherency_init
Date
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
\
 
 \ /
  Last update: 2021-11-15 11:54    [W:0.024 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site