Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3623720pxb; Mon, 24 Jan 2022 13:46:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlgSKSxHSxwJgifqgl0rLo7PfE4z50mIln0cnAjH8MY2VbVKlHQSOYgCTVcaqLOJic7tVj X-Received: by 2002:a17:902:a404:b0:148:b897:c658 with SMTP id p4-20020a170902a40400b00148b897c658mr16186858plq.71.1643060784438; Mon, 24 Jan 2022 13:46:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643060784; cv=none; d=google.com; s=arc-20160816; b=moW+/ntS+JomZ+/3AUvGPMfbGh0VQOUc5TzOia7kyCb65DmKeYfXYV7s2Y6OOXJgpm phIvc57NXUhkLDW7rMXthnzmAvzxdd92dP2VqpqZeVn+goCT9tNX9JXBGzsMOZUwccfN dqrS2bxOSXWmtmihEFQiuJmx8liiJPckArI/UYNp9w0hBGbLZ3xH60vk8eMfxkT/qEOf azD4fCn3uYLcnigZhArUxeg+8NJBrxxpyEC7mWYCWgAu0XZN7mvmK8LSmZr5Gz4gVxSm +OJ/F2TJ6gBmEQluR1YI6IjEX4OM3AF/8RyRLsUaGSeIfnmw+Y3nKrcrvD8dsDpea77l l1pA== 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=Sx3fCepeHhnpqENToBw3BK9HnTP73wFM5HzpaHqxx3GG565MC1P34B9/7HNaJndEev 1KpoRjTJOhyh8lGyWdKml+zJ4XP+jcfP3hZncG+EmLVfd4/eYeqdG6yTSv0MmsPlNUB6 hjdig9GZBwQAGDo3qdP+2ZYEkHSX+INL+z/91ryo3wGq8j8QkLbhbjnUfNjU3cPvH7DY SgmC3qV+miDh3C6mqYPYVeMmLcuhjZwLZ22Xa/5tAaVrBUFgKQGXO5ZsRFqIh83jcDuj ejmnRktLhupU3ppvX/8SR801cD9IQ/e0baO4GK98N68GjaJ33oae8Zjqr0mQLWfp86kF DBHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eOFEioLR; 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 m9si13424132plt.399.2022.01.24.13.46.12; Mon, 24 Jan 2022 13:46:24 -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=eOFEioLR; 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 S1451287AbiAXVWg (ORCPT + 99 others); Mon, 24 Jan 2022 16:22:36 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:48582 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442625AbiAXUzA (ORCPT ); Mon, 24 Jan 2022 15:55:00 -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 dfw.source.kernel.org (Postfix) with ESMTPS id E0CAC60907; Mon, 24 Jan 2022 20:54:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C08FC340E5; Mon, 24 Jan 2022 20:54:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057699; bh=es4VFNe9AaDnfs8Ou0sM7tYhD3qSg6+pBgcbz0bHUXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eOFEioLRvKZRrpQVJTK6iY5yci28mjq6ud+kMPO9vQGMux3YZ8ujs5bM42JAPOFXR i4nnPyomHNBljIhWzUbACq9+kw033RwNfgp0EYOti3JBwoqGrb+jzA4IjR6ckItuqg rykPACYds5XvfDHAnu8cr9hlMQgUTwJ2bwR+qOA8= 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.16 0017/1039] mtd: Fixed breaking list in __mtd_del_partition. Date: Mon, 24 Jan 2022 19:30:06 +0100 Message-Id: <20220124184125.723087290@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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;