From nobody Tue Dec 16 21:50:08 2025 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 7A40AC07545 for ; Sat, 21 Oct 2023 18:58:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231896AbjJUS65 (ORCPT ); Sat, 21 Oct 2023 14:58:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229633AbjJUS6y (ORCPT ); Sat, 21 Oct 2023 14:58:54 -0400 Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67E36FA; Sat, 21 Oct 2023 11:58:52 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id C271C6343CB4; Sat, 21 Oct 2023 20:58:50 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id P-b8PQmRRzfA; Sat, 21 Oct 2023 20:58:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 5BA596343CB5; Sat, 21 Oct 2023 20:58:50 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id WHulukewPv4l; Sat, 21 Oct 2023 20:58:50 +0200 (CEST) Received: from foxxylove.corp.sigma-star.at (unknown [82.150.214.1]) by lithops.sigma-star.at (Postfix) with ESMTPSA id 0B96B6343CB4; Sat, 21 Oct 2023 20:58:50 +0200 (CEST) From: Richard Weinberger To: linux-mtd@lists.infradead.org Cc: linux-kernel@vger.kernel.org, vigneshr@ti.com, richard@nod.at, miquel.raynal@bootlin.com, joern@lazybastard.org, Christoph Hellwig , stable@vger.kernel.org Subject: [PATCH] mtd: block2mtd: Add a valid holder to blkdev_put() Date: Sat, 21 Oct 2023 20:58:32 +0200 Message-Id: <20231021185832.25592-1-richard@nod.at> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Since commit 2736e8eeb0ccd ("block: use the holder as indication for exclus= ive opens") blkdev_put() requires a valid holder argument. So, do so also in block2mtd to unbreak bdev->bd_holder refcounting. Cc: Christoph Hellwig Cc: stable@vger.kernel.org Fixes: 2736e8eeb0ccd ("block: use the holder as indication for exclusive op= ens") Signed-off-by: Richard Weinberger Reviewed-by: Christoph Hellwig --- drivers/mtd/devices/block2mtd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mt= d.c index be106dc20ff3c..8c37650bbce45 100644 --- a/drivers/mtd/devices/block2mtd.c +++ b/drivers/mtd/devices/block2mtd.c @@ -209,7 +209,7 @@ static void block2mtd_free_device(struct block2mtd_dev = *dev) if (dev->blkdev) { invalidate_mapping_pages(dev->blkdev->bd_inode->i_mapping, 0, -1); - blkdev_put(dev->blkdev, NULL); + blkdev_put(dev->blkdev, dev); } =20 kfree(dev); --=20 2.35.3