Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3595549pxb; Mon, 24 Jan 2022 13:06:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJy54HUDR/KTVHIG2iuMH9QSyDb5uhtUgw2okiprz9ex1YN2Q4qt7m1l0W43iRYCzCfUgF64 X-Received: by 2002:a17:90a:f413:: with SMTP id ch19mr127906pjb.19.1643058403500; Mon, 24 Jan 2022 13:06:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643058403; cv=none; d=google.com; s=arc-20160816; b=RzPIQMQo+BdROVkIFp/Bzl10rGD7BxEqEszZ8PBBnIim0SaSiJvkPq+tfbLqKJdUp/ uE3I0KHJyx4gEsJoz288z+fIPPqThTNGjz6ri/D06KZ7tahkQzfGfhYvSmTtrp+Eu6kM vlf9bKrPCgX3jGJNNJfDbOFjUP0h3GZ1VeU8JeamaJs7ry0iU6HdmDElweS5aOpWKa7f 7BlUpCC7cS2Qeqy+oZNnIMn6iD5oq/VUrZttKDNsIBWGrnkR/HbkA5/4R48WdPYH6gQg 9N1bC1Adb14Wwi7PfJAJJytVnzlxq6HeNEXviEoQr6XQCDJ5qS0TbQT+k4Ozf1bKmEEe McHw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u1soyO13iDrk7u7sJQwQXgKC0yiqa368ZZmVNyLMLYM=; b=I+eP7n0PNQUye+3tr+rrlHL63L8lcBMgZ5QOwssbbm7RO3Wuyxl1IVboj2UIF0l5Cd QTaY4SRuwr+CUyrBvOn+L9gc9lfuuEqWQc8LS8PqivrtOi3SLhlv2MJS0UqwDSRwLoEQ wXY8r6mHEPiH2uKdYbon77gWvsc9TUyqzfirhj0/F5MEkVniH86qXpC1Qdy60C14oWTl Nu5vJN+cHQRTC0dGKkH+p2y/wo8yY4YDDxwy4UeqSJSzIHIwED609Hvqn96ASEGxLxyD 1TGVk+oHefni7hKRwFLwW/s9gICMdtb1q+VZ2VUMylf25DlMWQtpAHdiHCL0n3XcltH7 HcjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mWALHyhk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c76si14650854pga.630.2022.01.24.13.06.24; Mon, 24 Jan 2022 13:06:43 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mWALHyhk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384719AbiAXUa0 (ORCPT + 99 others); Mon, 24 Jan 2022 15:30:26 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:51928 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379110AbiAXUKX (ORCPT ); Mon, 24 Jan 2022 15:10:23 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2BFE5B810AF; Mon, 24 Jan 2022 20:10:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BB54C340E7; Mon, 24 Jan 2022 20:10:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643055018; bh=es4VFNe9AaDnfs8Ou0sM7tYhD3qSg6+pBgcbz0bHUXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mWALHyhkTjzYTWU4FbN29+KWeTdnzi6SljH2uVLcD3o6ICdyiWkuy61QZ5zDgEEr7 tY/B9G+84GSi0+bVgH+dmiC2K3R6qCkU1MxrDlGlirprTmbQcLSmouVFW7VQQRsvgA Okno4AGbzzQCY/FukNjnTiznH4j8klZeZ7zp8JZ0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andreas Oetken , Miquel Raynal Subject: [PATCH 5.15 015/846] mtd: Fixed breaking list in __mtd_del_partition. Date: Mon, 24 Jan 2022 19:32:12 +0100 Message-Id: <20220124184101.439970355@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andreas Oetken commit 2966daf7d253d9904b337b040dd7a43472858b8a upstream. Not the child partition should be removed from the partition list but the partition itself. Otherwise the partition list gets broken and any subsequent remove operations leads to a kernel panic. Fixes: 46b5889cc2c5 ("mtd: implement proper partition handling") Signed-off-by: Andreas Oetken Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211102172604.2921065-1-andreas.oetken@siemens-energy.com Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/mtdpart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c @@ -312,7 +312,7 @@ static int __mtd_del_partition(struct mt if (err) return err; - list_del(&child->part.node); + list_del(&mtd->part.node); free_partition(mtd); return 0;