From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0A1DC433F5 for ; Sun, 23 Jan 2022 15:23:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237474AbiAWPX2 (ORCPT ); Sun, 23 Jan 2022 10:23:28 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:44371 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237471AbiAWPXW (ORCPT ); Sun, 23 Jan 2022 10:23:22 -0500 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id B4091200002; Sun, 23 Jan 2022 15:23:16 +0000 (UTC) From: Miquel Raynal To: Ansuel Smith , Andy Gross , Bjorn Andersson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Manivannan Sadhasivam , linux-arm-msm@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] mtd: parsers: qcom: Fix kernel panic on skipped partition Date: Sun, 23 Jan 2022 16:23:16 +0100 Message-Id: <20220123152316.529559-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220116032211.9728-1-ansuelsmth@gmail.com> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'3c4539442c775a11d681784ade12c77adba34893' Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2022-01-16 at 03:22:10 UTC, Ansuel Smith wrote: > In the event of a skipped partition (case when the entry name is empty) > the kernel panics in the cleanup function as the name entry is NULL. > Rework the parser logic by first checking the real partition number and > then allocate the space and set the data for the valid partitions. > > The logic was also fundamentally wrong as with a skipped partition, the > parts number returned was incorrect by not decreasing it for the skipped > partitions. > > Fixes: 803eb12 ("mtd: parsers: Add Qcom SMEM parser") > Signed-off-by: Ansuel Smith Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks. Miquel