Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2223681/?format=api
{ "id": 2223681, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2223681/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20260416011128.45754-1-dbgh9129@gmail.com/", "project": { "id": 3, "url": "http://patchwork.ozlabs.org/api/1.1/projects/3/?format=api", "name": "Linux MTD development", "link_name": "linux-mtd", "list_id": "linux-mtd.lists.infradead.org", "list_email": "linux-mtd@lists.infradead.org", "web_url": null, "scm_url": null, "webscm_url": null }, "msgid": "<20260416011128.45754-1-dbgh9129@gmail.com>", "date": "2026-04-16T01:11:28", "name": "[v1] mtd: ubi: fix kref leak on -EBUSY return in ubi_detach_mtd_dev()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "3937f3a03bb546168be166afcd05a4ca55bcb401", "submitter": { "id": 93165, "url": "http://patchwork.ozlabs.org/api/1.1/people/93165/?format=api", "name": "최유호", "email": "dbgh9129@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20260416011128.45754-1-dbgh9129@gmail.com/mbox/", "series": [ { "id": 500062, "url": "http://patchwork.ozlabs.org/api/1.1/series/500062/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=500062", "date": "2026-04-16T01:11:28", "name": "[v1] mtd: ubi: fix kref leak on -EBUSY return in ubi_detach_mtd_dev()", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/500062/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2223681/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2223681/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=p0G/bjd5;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=R0K+wkp0;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=temperror (SPF Temporary Error: DNS Timeout)\n smtp.helo=bombadil.infradead.org (client-ip=2607:7c80:54:3::133;\n helo=bombadil.infradead.org;\n envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fx0Np18g9z1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 11:11:57 +1000 (AEST)", "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wDBGa-00000001pxb-0iIo;\n\tThu, 16 Apr 2026 01:11:36 +0000", "from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wDBGY-00000001px3-2PN8\n\tfor linux-mtd@lists.infradead.org;\n\tThu, 16 Apr 2026 01:11:35 +0000", "by mail-qk1-x729.google.com with SMTP id\n af79cd13be357-8d00cf835b7so901127485a.1\n for <linux-mtd@lists.infradead.org>;\n Wed, 15 Apr 2026 18:11:33 -0700 (PDT)", "from localhost.localdomain ([165.85.38.17])\n by smtp.gmail.com with ESMTPSA id\n af79cd13be357-8e4f29227a5sm244769885a.32.2026.04.15.18.11.31\n (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);\n Wed, 15 Apr 2026 18:11:32 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc\n\t:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:\n\tResent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:\n\tList-Owner; bh=INnFxs/Ma4pu+AV1yE8J3AgLKZeiJhMNXjW95u031CI=; b=p0G/bjd55cuTGE\n\tFSLqVY48IthmCn8mm06bo7AUQ8j8ohdt/iSd2yo8eRitNYEev3cY8pA0pxxa/pX7aGsHG1FaFP1jS\n\tFvh2tqHE426QTQlP11XFpaqQqlTBrh2xIF8D3I3PNE7VFgIA8Os1u/XncLcNeQt0k0ZdxJQslsx8b\n\tQMkW2NkHr496kxHEwV7sYhHz6c4+WVP3ID2V4dOu1cXbRqXGe2Bmzb/7CjH8ZPCWYR563KgTz5OXX\n\tfe1OjHpsP4ajP6n5YxbV46LQ6Z75ji2tSm/GFLHunEjUdSoCswZYXlffPUrxpVo3RNxU1ekSn4KFr\n\tJh52nAZq9gjc5KiR64wg==;", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776301892; x=1776906692;\n darn=lists.infradead.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=QfpySMydajhmy8CDZ0KzUQHaW9x3r0jflQmjPEkL1UA=;\n b=R0K+wkp0CFDAoUzecBoj52MjL9wwexyTnLh7qySXChaFJlkaWWIqbWU5NqorhoIS2v\n 0HpDGwMO98wk/J6IRUCThpaZm+P9eiwTN8rj6OOsqmczgYE2sm8Z7YlXBtw5tytc+6eI\n y4r8xcC1howCGHBHRdpZhR5iaEqfT2aa3jqYWo6T8PhUDNoMpIuSBwVdhruMGBs5Wy7w\n GlHjLcTUW20AMf0sBEtSTb9WrjqN03Iy/gXlReB9ijl/SpLanxSGmjnl8uooJWDdesVn\n fsLG5DTBQ02lZAQ9a1BzwJ/bawmOpiSfX25I7WKY7+tNC10B54eVTxLPVidCPMll1+Yg\n bpSg==" ], "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776301893; x=1776906693;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=QfpySMydajhmy8CDZ0KzUQHaW9x3r0jflQmjPEkL1UA=;\n b=M2ZH8le/97Z0wzEPShoNP+DM7/oOhnCHVxPCfyyCt+/Mh7Fl/p1adHEvqbaJEsiRAP\n Ajg/zV6XLONoQp2l8gSvNU7cpeuCEFI3kRL4dTB/V2jbkSpBMzZv6/eUdZyv1Vfdo+sa\n EbIz1ko7+2p+pWC37M9+esDTL91qXl2NzUO+ws8Zd389BuLvAt2ygAgaVOAXy3m4GRxp\n zafh+JdS+v6RZ+8Hyt75LCGzPzzM4cGb+5XI+ArhZXDxJRImRUHNqaL7Y7QLk9AtTQ11\n YimRSf7XaYHpVHe1zYAdnuHF2OQUWIJmDPlQ9K7hD/xHvsvCAt0T3wiTzffmv8qGKwZU\n MFlg==", "X-Forwarded-Encrypted": "i=1;\n AFNElJ8r/a0V1bRlvb2OstfX/wr+Lm7pqLmHNpFpjai0oBB43lyQeebRtubYjw2unvS4jpQv9dxK45zU9Ew=@lists.infradead.org", "X-Gm-Message-State": "AOJu0YyDI0py0rkQ3J9lf4AUHTMQ/uAtyLQ8Xt206oIO6+R5rl2PC1zx\n\tQSvrEm2fKSEDh7v6rO/Wbl+NyZcNM6+z+X3t7JCAynyjPyBwxuhq2e2F", "X-Gm-Gg": "AeBDiesAZQsaqPvS0Bxu/JbnwAh0aqgieK41OiDWmU/2dO62yVxsFWCgd1NJR18eG14\n\t3+fJO9pXXevQJLPrXvy3OdjfAPyDVVlExvOKtXiRpiiBSoRkpDcHd0fxdhLWv8D2t50zLWhOcXj\n\t7dydmbnHx8YMrKPcV7hF/UYooSPySiFD86zolCw7TnhWygi6zidLAFvTwuRgdTGn1NEEJCHfa+D\n\tAkCss3fyYxxvCiEtNIy3wh/hfJhi39JLJgtXo9jZhRP9gS1jNRc3nZXgzvJqyW7bsKCt/lc+Fpg\n\txImJeZhVF6/JDM+lGMEed/8ZoAjcBsMnaBi2SBCV6rMmElKOyhYGF5AJCbYB3vndAzDX4R0BpFH\n\t76eckP5KeOicJAGAX9J31bKtmZAdh3LpeBHuu8Kj0iViozi6ifKYmMXUZja0mM1B72uQqLdbHhb\n\tJmtin13JswkuCivSXatsEHygeltXjqdgyJl8zlXOGhg6Vl2cuKwht2M9o4uw==", "X-Received": "by 2002:a05:620a:d86:b0:8cf:cfdf:7346 with SMTP id\n af79cd13be357-8ddcecbd993mr3555177485a.30.1776301892568;\n Wed, 15 Apr 2026 18:11:32 -0700 (PDT)", "From": "Yuho Choi <dbgh9129@gmail.com>", "To": "Richard Weinberger <richard@nod.at>,\n\tMiquel Raynal <miquel.raynal@bootlin.com>,\n\tVignesh Raghavendra <vigneshr@ti.com>", "Cc": "Zhihao Cheng <chengzhihao1@huawei.com>,\n\tlinux-mtd@lists.infradead.org,\n\tlinux-kernel@vger.kernel.org,\n\tYuho Choi <dbgh9129@gmail.com>", "Subject": "[PATCH v1] mtd: ubi: fix kref leak on -EBUSY return in\n ubi_detach_mtd_dev()", "Date": "Wed, 15 Apr 2026 21:11:28 -0400", "Message-ID": "<20260416011128.45754-1-dbgh9129@gmail.com>", "X-Mailer": "git-send-email 2.50.1", "MIME-Version": "1.0", "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ", "X-CRM114-CacheID": "sfid-20260415_181134_642639_7C5E2582 ", "X-CRM114-Status": "GOOD ( 11.90 )", "X-Spam-Score": "-1.8 (-)", "X-Spam-Report": "Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam. The original\n message has been attached to this so you can view it or label\n similar future email. If you have any questions, see\n the administrator of that system for details.\n Content preview: ubi_detach_mtd_dev() calls ubi_get_device() which\n increments\n both ubi->ref_count and the device kref via get_device(). When the device\n is busy and anyway==0, the function returns -EBUSY after releasin [...]\n Content analysis details: (-1.8 points, 5.0 required)\n pts rule name description\n ---- ----------------------\n --------------------------------------------------\n -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no\n trust\n [2607:f8b0:4864:20:0:0:0:729 listed in]\n [list.dnswl.org]\n -0.0 SPF_PASS SPF: sender matches SPF record\n 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record\n -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from\n envelope-from domain\n 0.1 DKIM_SIGNED Message has a DKIM or DK signature,\n not necessarily valid\n -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n author's\n domain\n -0.1 DKIM_VALID Message has at least one valid DKIM or DK\n signature\n -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%\n [score: 0.0000]\n 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in\n digit\n [dbgh9129(at)gmail.com]\n 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n provider\n [dbgh9129(at)gmail.com]", "X-BeenThere": "linux-mtd@lists.infradead.org", "X-Mailman-Version": "2.1.34", "Precedence": "list", "List-Id": "Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>", "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-mtd>,\n <mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>", "List-Archive": "<http://lists.infradead.org/pipermail/linux-mtd/>", "List-Post": "<mailto:linux-mtd@lists.infradead.org>", "List-Help": "<mailto:linux-mtd-request@lists.infradead.org?subject=help>", "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>", "Errors-To": "linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org" }, "content": "ubi_detach_mtd_dev() calls ubi_get_device() which increments both\nubi->ref_count and the device kref via get_device(). When the device\nis busy and anyway==0, the function returns -EBUSY after releasing\nubi_devices_lock, but never calls put_device() to drop the kref\nacquired by ubi_get_device(). This leaks the kref, preventing the\ndevice from ever being freed.\n\nCommit 7e84c961b2eb (\"mtd: ubi: introduce pre-removal notification\nfor UBI volumes\") moved put_device() to after ubi->is_dead = true\nto pair it with the notify+nullify sequence, but inadvertently left\nthe early -EBUSY return without a matching put_device().\n\nAdd put_device(&ubi->dev) before returning -EBUSY to balance the\nget_device() inside ubi_get_device().\n\nFixes: 7e84c961b2eb (\"mtd: ubi: introduce pre-removal notification for UBI volumes\")\nSigned-off-by: Yuho Choi <dbgh9129@gmail.com>\n---\n drivers/mtd/ubi/build.c | 1 +\n 1 file changed, 1 insertion(+)", "diff": "diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c\nindex 674ad87809df0..d81f5e0395ac0 100644\n--- a/drivers/mtd/ubi/build.c\n+++ b/drivers/mtd/ubi/build.c\n@@ -1106,6 +1106,7 @@ int ubi_detach_mtd_dev(int ubi_num, int anyway)\n \tif (ubi->ref_count) {\n \t\tif (!anyway) {\n \t\t\tspin_unlock(&ubi_devices_lock);\n+\t\t\tput_device(&ubi->dev);\n \t\t\treturn -EBUSY;\n \t\t}\n \t\t/* This may only happen if there is a bug */\n", "prefixes": [ "v1" ] }