Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp394650rda; Sat, 21 Oct 2023 12:21:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEFXLIcgDIOJMltZrhG3M4wSWEWcT8+KkiAQD3xw2hsCSLWnSeVZQY4hvDWiZu+jpgdMZos X-Received: by 2002:a17:902:b28a:b0:1ca:3e64:2372 with SMTP id u10-20020a170902b28a00b001ca3e642372mr4211006plr.41.1697916066383; Sat, 21 Oct 2023 12:21:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697916066; cv=none; d=google.com; s=arc-20160816; b=ohuZ6DA8cirGSeLKoOHsw2qNjaycM1euk0i/xsJSnta7KuvM5Dg14mp5IwDRd5Ix6i 3/oGJshIQHvZB7QgFNe+hHvWcIUBeaQ1B0ZNuvE1EDewZgJPFxJNm0VHH/LNHBAEZex2 uIjj1MAYQibJqN5zMg4ckx6xf5ZtDEBrE6IwSUT3CQCLX5s2RBVOn+9lCZgp+ObLod8Q SqAfW6a2N+bbiNSNYgEYftGmW3SlLXb06zaOBc4HDWGLmAYMLvR8Z7StEgKTr/gT3m/y 6B5vNYKnkeX1ALCUa2RP7BRtdvwLLm1cBaM7o0tNCMq9rdn500ZuaOXacrEgN3DTD0sM Yrug== 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 :message-id:date:subject:cc:to:from; bh=Ur/jENnWldqX7N++EF7GCzamA8aZ1LbmjW4aBALTMfQ=; fh=ufBjI4Hwn/WX9wIO+xBQfEUEOeOjxnWhtoXpOcaRBUE=; b=xqshB21kNnIE1rr0LIVi1Q5NMBCRiJOJUNZ6fpEDd5KgfV9Xq+zXwgkpvO17qk5YUd +pj2+vWHgOar4vPX3gu53CssZw6GxSi8buEbMLh7EeZAW1Lv2ejhIB9hdH5+yBB5nAVf P+1w9JTsRuhkDCpe0H/pl3koQo0uOaGiTwDZ2Cu85xcpnrH5bhb8Xm599coQHsY8wXdJ YijaKGvbWManggJt7xvMTAb5wsbovnF5vP2tvphJDYP0E/8u4ftnZK3puBNHGMrlSwzV uWxlk4NomL6XPminCtbHs5yxM/G/lsrwVHqlp2dCtTWqU3oz65JNbtvYARvatrCfwzod fFLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id a15-20020a170902eccf00b001b8a67f1c10si4011778plh.468.2023.10.21.12.21.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 12:21:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 32D2B806B9E4; Sat, 21 Oct 2023 12:21:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229621AbjJUS64 (ORCPT + 99 others); Sat, 21 Oct 2023 14:58:56 -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 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sat, 21 Oct 2023 12:21:04 -0700 (PDT) Since commit 2736e8eeb0ccd ("block: use the holder as indication for excl= usive 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 = opens") Signed-off-by: Richard Weinberger --- 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/block2= mtd.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_de= v *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