Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3074871pxb; Mon, 24 Jan 2022 01:40:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRvzAxXhAC1NXnBy+Ih7artkXdec9WyYJb2nv11WHIjk4MIltTWey7owtgRnIvh/C+axnr X-Received: by 2002:a17:902:cecc:b0:14b:287a:a02b with SMTP id d12-20020a170902cecc00b0014b287aa02bmr10634115plg.61.1643017216244; Mon, 24 Jan 2022 01:40:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643017216; cv=none; d=google.com; s=arc-20160816; b=gcQcABnUIKF+/hBlkGH/xpZSuSP4l8Rcouy+hVbeRU9sor739ND03mnR9f/8CJttzi rQIdfZZmSd6XwOJT1RlIpZSOB4I5iC9M8SsicmG1kfgr7msNArW65DOQc0RcRLg8dkZT gv1rTSOe0TC2efc8Q0DPms7Q0EsHRdjwdyz6JjVQ2Dq1TGdiLtiXxdrVwjxCRLl9+UtO c2WgRB0n9hG5L/XPwa2OizbSAaaluAStOugitJygZ3OR4h4AOP909mGtP9NYLtXLRYxL b9QB2w5FN++/rqRRmB6Mo8u9JzjZU6YmCwZe0ffwycmYKL41/km/NSRY/zz/dDM5Cc+Q GVrw== 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 :references:in-reply-to:message-id:date:subject:to:from; bh=AoijT0uEGV/KjwCO0GLeGT3p9Ac/MpWcAvrKd9Gnm4s=; b=j3vXlTOghtqF7+/2/0EEzBp+P8XPEjlHfyXSnVHYmIZasuKqZGBQJjsMabKH+cL4Tf yn7PH4DQlG/qI0qP6gEo/EjU0agtEnJbQHSDpAGcmWb0LD94e7LW2tqvdfFISI3RMfUU UC0lUAYVfd3xBV2XTPrJRJJrUumaXsqbjfgGdejJ6GdHfrpraQTS2DwnDjEmYsgauFxZ 3529bkeiEN5yEiXTCb0PurCrW+PMN9c7gPls7PQu7OiyhGNxo77jdT7Za+wre3E0OOrA ORDifMWQMKOxxdHJfBniK84D0YoF9KZI+lHfTqOQRN105iy8T6er0SAdR4/R3DhSzWja idMw== 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 l1si11560527pff.40.2022.01.24.01.39.50; Mon, 24 Jan 2022 01:40:16 -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 S232743AbiAWPX0 (ORCPT + 99 others); Sun, 23 Jan 2022 10:23:26 -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