From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 1D0C629898B for ; Mon, 19 Jan 2026 10:49:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768819800; cv=none; b=PnSkY8wHoOYap37RLjsCpaz5nohgyPmnTQMGq+4qYEMeAS+5kyzA2nMPHDz/KEwTC10MsC6L4LrbHyIyyCWlWaT7zPkbaaiG3wz9t5EUSFdz+Wg123SsycpHra+scLTI93H6nQMCM8DpT97GD7HGFljQyr+by+mTuI6eridVzrw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768819800; c=relaxed/simple; bh=jI9noFODgi1+GylsOo5Ny2Ig7HAj1yGBXFmqgPtM9JQ=; h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date: MIME-Version:Content-Type; b=BFeZooGnZ43/wfS+iIX82306YViRJq8w3eS2mbbTEjYwxVmMBksDJ0ZIbYkYyDHgRsNMlLUaUV9+t4rNLe+evkage8MnduqP4aDWh/FhMCYT9NCYOtFgJ/Fr429+EUM3D7oS0FZ0fojHIjic7d/+aUFKxYRot9Jf6z5u3vBCGT8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=I5iYDzk9; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="I5iYDzk9" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id BB5A21A293D; Mon, 19 Jan 2026 10:49:57 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 885CD60731; Mon, 19 Jan 2026 10:49:57 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id B7AFB10B6AE98; Mon, 19 Jan 2026 11:49:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1768819782; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=8HkG350TcjKySrUj6co0juo2I7dugMCT1DsmkateZpo=; b=I5iYDzk9sI71uCw8HK21Lt21nWym0wQaVJCEUduPpdDXGmuZsvcI/hBLBQw0uwEFaDbvOh s2vCwtFAQUXeV/TjzJ/mDQ+EJvxeSCqcJoYyB4KbnKZ7dB8dOu+CMjeP0W6CXgSi28fV7C CqdiS1gu9YM8nX6NHHqZzKzkUbjDsKHs6fA417CffmU1pJJolvLBEw5SYDNVgUkD/V18wT B+9oayHJlkjp7yd9UcCgpIta1lLj4x7u+7ys5j015+wBosfASwZ64sIoEGfueO6qQBOloS 4Wiz1PRiFGHgc1GzzlegRkeTgEGX0/5ERL0ZZI33efvVXkEtC6F6Ew5f6lS2QQ== From: Miquel Raynal To: Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Alexander Usyskin Cc: Reuven Abliyev , "Gustavo A . R . Silva" , Raag Jadav , Jani Partanen , Lucas De Marchi In-Reply-To: <20260115052237.1149027-1-alexander.usyskin@intel.com> References: <20260115052237.1149027-1-alexander.usyskin@intel.com> Subject: Re: [PATCH] mtd: intel-dg: Fix accessing regions before setting nregions Message-Id: <176881977899.2473586.16375546520519184809.b4-ty@bootlin.com> Date: Mon, 19 Jan 2026 11:49:38 +0100 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="utf-8" Content-Transfer-Encoding: 8bit X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 On Thu, 15 Jan 2026 07:22:37 +0200, Alexander Usyskin wrote: > The regions array is counted by nregions, but it's set only after > accessing it: > > [] UBSAN: array-index-out-of-bounds in drivers/mtd/devices/mtd_intel_dg.c:750:15 > [] index 0 is out of range for type ' [*]' > > Fix it by also fixing an undesired behavior: the loop silently ignores > ENOMEM and continues setting the other entries. > > [...] Applied to mtd/next, thanks! [1/1] mtd: intel-dg: Fix accessing regions before setting nregions commit: 779c59274d03cc5c07237a2c845dfb71cff77705 Patche(s) should be available on mtd/linux.git and will be part of the next PR (provided that no robot complains by then). Kind regards, Miquèl