From nobody Mon Apr 6 19:59:52 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CCF537B039 for ; Wed, 18 Mar 2026 08:22:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773822125; cv=none; b=CnMLGpZaPyU6yrFl1GJq99XD0LURo6JYCaZ2/latzE+1HZ/LjJhAO4JTDVGrKwf8NU/I8hkBDz77U0H2gV7Uhoxl4DkWc3asB4Sw4foVEMt+Ni8zhAbA5R+dMyuYWPDuG4vheY8M97AwGCSmdvW6wUlcIUbZZ2RiJYQFLm/VlBw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773822125; c=relaxed/simple; bh=OM+VMotWwTJOcVNNxrOjkcF9JBC7Z4eSMHRQHB2Xy+k=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=iGcsgEMFzIpzqGnkep2xansCJrA1fA86/MIqubqhMAPYYyUPn+n1ziLpAesPwD1397dQ7f2tGQf+wNQ39Arhi7W/d/sdDQ7tdLtu/1/jLgSv+38+mft76L4XM3E/vcyyqnnR9RrHuzvFZfcnaK5pjijbC3hgK6hP2W5bYXzv68Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 87e9b0a222a311f1a21c59e7364eecb8-20260318 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.11,REQID:517c93f7-a0b9-47f8-93e6-f1014873366f,IP:0,U RL:0,TC:0,Content:-5,EDM:25,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:20 X-CID-META: VersionHash:89c9d04,CLOUDID:4088885d7b2ceb3a44a7619703b93cfa,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:102|850|898,TC:nil,Content:0|15|50,EDM:5 ,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV :0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 87e9b0a222a311f1a21c59e7364eecb8-20260318 X-User: lijun01@kylinos.cn Received: from localhost.localdomain [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1654943835; Wed, 18 Mar 2026 16:21:58 +0800 From: Li Jun To: andrew@lunn.ch, gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, lijun01@kylinos.cn Subject: [PATCH v2] arm: mvebu: fix null pointer when access Date: Wed, 18 Mar 2026 16:21:43 +0800 Message-Id: <20260318082143.2560586-1-lijun01@kylinos.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" the kzalloc&kstrdup may return null pointer, will cause kernel panic. -Fix null pointer. Signed-off-by: Li Jun --- arch/arm/mach-mvebu/coherency.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherenc= y.c index a6b621ff0b87..f9411e16ddbb 100644 --- a/arch/arm/mach-mvebu/coherency.c +++ b/arch/arm/mach-mvebu/coherency.c @@ -191,7 +191,13 @@ static void __init armada_375_380_coherency_init(struc= t device_node *np) struct property *p; =20 p =3D kzalloc(sizeof(*p), GFP_KERNEL); + if (!p) + return; p->name =3D kstrdup("arm,io-coherent", GFP_KERNEL); + if (!p->name) { + kfree(p); + return; + } of_add_property(cache_dn, p); } } --=20 2.25.1