Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3076301pxb; Mon, 24 Jan 2022 01:42:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwapKdL2GiNuTys0Zv71gP/r0ciQkDgsBqrA/PKC0znQg4T3X8JqcGZvFQH1UXL5Y1jW2Xj X-Received: by 2002:a62:1ec3:0:b0:4bb:ea7d:6c4f with SMTP id e186-20020a621ec3000000b004bbea7d6c4fmr13260490pfe.4.1643017372161; Mon, 24 Jan 2022 01:42:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643017372; cv=none; d=google.com; s=arc-20160816; b=ibYON1jTEraEbIiUKC7YnJ+fIxHDrxDvEYvKUzU3e97H3UE/CfXI9ioDNQl7LxoOEm Dppd6HTsbIcJhUdIcurzVgl4v6s1LTGNjk5I5yCS1mySimOI1SzLZccvjdG4LHgMpPtc RpTIYpRhl1WM1nryYstbfcvvDU+Vw1la4W2tjtySheyEselfOWw7AAA5jZcVYETZnGVo oyzdCHsEvxNNzWJN1WxoSdtPQdLKLe0Kxwhzeo9NMtVEFRxUkxuV/TsjHtPvm0cKkqbF FTbpA/i0EN5iGkCBa3PZHbcoxx5KcbvWks6mB+pB7IMxvg9rW/lU74KThGgC58JuU34y L+Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:to:from:date; bh=235OHNdrFVJIx+VwRBzQSsW5ku/hj4JT/b7gJHPmQrk=; b=jultGkqZnrt+FepihaQYJhHq294IQE799y6Mx4FkW/471uft6BJImah4c7yRjbxZrb 58saukoec3kQTNo2gkgpNG6pHtPig1BTzpjUusfLVc8MmyNwoFHrlEVraLFrSQgmu2oJ YoQ4vaYS1VCOETTo236V+6upluFal0apU407Ih9pA80CCZJhUNxZPESXVdiraAYi84Uw BStv2oHiAoawUDx5uNIm1uF99X2W3sKHhFXk08VenpEqiU6rcaBifJykzIGOHhX3/lWE PyIYx1bIbIluZKyEUMDvnK9nxD7k3DCstnEw66eekckDBPdDGyBAPV2MqRqQBsM0NJXK Mnbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v25si9256892pgl.343.2022.01.24.01.42.40; Mon, 24 Jan 2022 01:42:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237718AbiAWPcn (ORCPT + 99 others); Sun, 23 Jan 2022 10:32:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237696AbiAWPcm (ORCPT ); Sun, 23 Jan 2022 10:32:42 -0500 X-Greylist: delayed 567 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 23 Jan 2022 07:32:42 PST Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2FDDC06173B; Sun, 23 Jan 2022 07:32:41 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 526A7FF802; Sun, 23 Jan 2022 15:32:39 +0000 (UTC) Date: Sun, 23 Jan 2022 16:32:38 +0100 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 Message-ID: <20220123163238.12eb2616@xps13> In-Reply-To: <20220123152316.529559-1-miquel.raynal@bootlin.com> References: <20220116032211.9728-1-ansuelsmth@gmail.com> <20220123152316.529559-1-miquel.raynal@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org miquel.raynal@bootlin.com wrote on Sun, 23 Jan 2022 16:23:16 +0100: > 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. Both patches applied on mtd/fixes, actually.