From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (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 69F3231353B for ; Wed, 18 Mar 2026 13:39:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773841143; cv=none; b=L6LYEw1NrxVqzRDvAjifQkEiGOpoKm9qwaRBNxIhWFPW6PG7nUpEcxD6/F/orT4jZkTkUKG8mLrQs+ZLT+BY5/BW5JydpFbumgmup9At9c4qQg92rBG8plHbcovg/j0QCVSZvCBLsS8YiKH2mx5ymNeKxtgq2Cs+f6j9bGexD/A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773841143; c=relaxed/simple; bh=3K5k3JgguhfxnSTYiIskeCWzy8SkgoYjhyS9BacSH6U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jFzVYFx+hGQGAMshD8O0BUH4ibyMp4X+GSV92HdnBMKSY/wa7EQY3T0HXNQUklizTzqlrbqX+6Cd9ITqW6bD6JGgMxcT/MlCSEzgf5Qu6FfFoVDh6ydAWEBKyvrPnNr9O5qVnqdPtow/kVkLubyqvpiwUl34kKO7enDK2lX4hRg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=vclGRwYd; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="vclGRwYd" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=n226cTQo7HXeyALY/WS5jRXXBORyR/AeC4LnRev1Kx0=; b=vclGRwYd+AjNihq5c4sx5BBFGe Ke+AQgTQPKqMJ2dI86hh+OXB1Sg9rF/pxtCggQZqKwsj9VcsxJVok9ODsh+k96l8/OprRYeNs/Q6/ /DLiNAHNQdUqESdntoNopGbYQQDpTYOyBVS4ss46hIfrk9NDCzQBNK9zszbrw1WT61Wg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1w2r6s-00CCoL-Kb; Wed, 18 Mar 2026 14:38:54 +0100 Date: Wed, 18 Mar 2026 14:38:54 +0100 From: Andrew Lunn To: Li Jun Cc: gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] arm: mvebu: fix null pointer when access Message-ID: <4ba47ee5-a353-4083-a16e-b46afddd0d81@lunn.ch> References: <20260318085923.2610585-1-lijun01@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260318085923.2610585-1-lijun01@kylinos.cn> On Wed, Mar 18, 2026 at 04:59:23PM +0800, Li Jun wrote: > the kzalloc&kstrdup may return null pointer, will cause kernel panic. > > -Fix null pointer. > > Signed-off-by: Li Jun > --- > arch/arm/mach-mvebu/board-v7.c | 10 ++++++++++ > arch/arm/mach-mvebu/coherency.c | 6 ++++++ > arch/arm/mach-mxs/mach-mxs.c | 4 ++-- > arch/arm/mach-versatile/versatile.c | 6 ++++++ 4 versions in less than 24 hours.... Also, please don't mix different machine architectures together in one patch. They have different Maintainers. > diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c > index 04ad651d13a0..a3b1aa48162b 100644 > --- a/arch/arm/mach-mvebu/board-v7.c > +++ b/arch/arm/mach-mvebu/board-v7.c > @@ -128,11 +128,21 @@ static void __init i2c_quirk(void) > struct property *new_compat; > > new_compat = kzalloc(sizeof(*new_compat), GFP_KERNEL); > + if (!new_compat) > + return -ENOMEM; When you compiled this, did you get any sort of warning? As you can see above i2c_quirk() is a void function. Andrew