get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2223583/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2223583,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2223583/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20260415170027.3593563-1-lgs201920130244@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": "<20260415170027.3593563-1-lgs201920130244@gmail.com>",
    "date": "2026-04-15T17:00:27",
    "name": "mtd: maps: physmap: fix reference leak on failed device registration",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "c1b5aeae1245e3e44082517c592761f5fc6c30b2",
    "submitter": {
        "id": 91722,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/91722/?format=api",
        "name": "Guangshuo Li",
        "email": "lgs201920130244@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20260415170027.3593563-1-lgs201920130244@gmail.com/mbox/",
    "series": [
        {
            "id": 500016,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/500016/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=500016",
            "date": "2026-04-15T17:00:27",
            "name": "mtd: maps: physmap: fix reference leak on failed device registration",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/500016/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2223583/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2223583/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=ntVJMmcD;\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=gnaBYO47;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; 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 4fwnTp4N8zz1yHM\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 03:00:56 +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 1wD3bY-00000001QmZ-115N;\n\tWed, 15 Apr 2026 17:00:44 +0000",
            "from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wD3bU-00000001QmA-2UvL\n\tfor linux-mtd@lists.infradead.org;\n\tWed, 15 Apr 2026 17:00:41 +0000",
            "by mail-pl1-x62b.google.com with SMTP id\n d9443c01a7336-2ad617d5b80so38835895ad.1\n        for <linux-mtd@lists.infradead.org>;\n Wed, 15 Apr 2026 10:00:39 -0700 (PDT)",
            "from lgs.. ([2409:893d:1171:10e2:48dd:8f21:beaa:cec8])\n        by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2b4780ef365sm25319625ad.1.2026.04.15.10.00.34\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Wed, 15 Apr 2026 10:00:38 -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=u1lxCYb7Jn5YkPUY47PInjyRJ26+/nidvMib4dkNkNE=; b=ntVJMmcDDFAKQz\n\t907pd4wZvHm3evCM2UCO9ExM1z+A/gIbeY2nbA/JVFAtG2aHEEAZWRhQ8WZDR9gd9nboPpNSVgJWN\n\t+6/KNNLoBfwensO3RwLWyeSceJ2fviOnMkRDbLmDrRrBL1hfi1BWFhb5HCyAcKl4+CTV2be24Zsvh\n\tmaEcgQxTBm1X2A/cgk2CjUbnEz6kih9MNDOFzkL4b0s8rh27FfuOZGET7P45vSQQ2CrKOka/0tDHf\n\tslZhCdBLR/2u8pxn+6Bdr+eo1nIfVhZ3oIhEwNOR39006e6yweHqotUUxPgh/y7EHOPIf7wuYzeCG\n\tSVJhYIxwgqUr3cMwX0Og==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1776272439; x=1776877239;\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=tJqWM7Qg/yxY9S66GjsuTrsJ7EEWVnPgKW5QeWWEd6M=;\n        b=gnaBYO47HeAsEdQANyGYHfUryOKBt4uqLI7iPSxEtdElmRPhfQohSTGpIQP+FSSYjS\n         rEgqoPhveeUyVGMKa1SVh3LUaGYapkfc5FKInrDeohQyw3GI7GsZiL8EPwWNQ0gZQ2C6\n         Xxpb/z+hdAhJz1E7JdxlCGw4Hf2DvJuVVAKkP5bLAmdDs5IlLs9mUy42fd2YPFdT/eBO\n         1oNF/MAzy4vuA4sWJguQY57LQDdmsSP0LZTNj99QbErGfofPaXHt1x1pzAKDSHsyBxJR\n         9dsRfx1XHQd4Z67vLNa5F0jcyzwzaOuEEr2q+TfQ6FPxILue0Ipa/tDvo+DjWKeItmIz\n         Ts8Q=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1776272439; x=1776877239;\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=tJqWM7Qg/yxY9S66GjsuTrsJ7EEWVnPgKW5QeWWEd6M=;\n        b=J1kvE6E64e5v8QkqPRQAkZv4g9xgyFbOCDt+hGbmpuB8vOjPsiiIWEYuGVSssZ9Ba7\n         ir1E1UfrYLrUbvars802YEP+rolbeQQmsNbhKiVrHXLP/EcFizyu9t8Rf08kv7RPJLsN\n         3X9pAYQMMxcuiF/08bCkSL9g4Oma8Wox81cFIvSKdxjwRt5R5oUOKphCGjovJBYVy3m5\n         aVkLyY7pzCUdlp9nL//igMqv1qsYBzZ13/Sp9FSPoNlsjy0yDbakBzENvKihxEcw4f8k\n         JjJj26/JUqB0+sLR+DlV9oaeDxpb0FfsxHGBgqyN3rVcYE7k4EjKk7NM3MAcZzb8uVLr\n         bxJQ==",
        "X-Forwarded-Encrypted": "i=1;\n AFNElJ8kPidAj0yfJV4AXSPHbyoGCYBBZQJinn2cXpQqPjYATjYQ82F/oGHLHg28R2VRidXIcrgFh5yM7Ak=@lists.infradead.org",
        "X-Gm-Message-State": "AOJu0Yx1m5wPIB38wv3akUrrqp4uVkWrN+E30Jq8cX0OMG+scsScv3cB\n\tDDA5p3fYR7ZI0jS3wiLsuMVIPlwx9SP2ynBETCPqPewvH4XNYxXRyEwG",
        "X-Gm-Gg": "AeBDieuiKLpT9RYqZiYV7QklLrkkr0drRaMznViu9K9jI38T17GjSUMcMiguE93gY9p\n\tLeuUYvM5vgMoOdduuMQOqwDo2+fIZ96J+eLeL6gqYun+Tjf09Ah83kQEhpjeFP7Il1P6qmXNvzE\n\tQdRgbOycfo3rKG9z+3cFWGJv8fD49ykppsbz2D6r5nr0s983rv8yz9swVNi6HYal+9DnJKQkgfG\n\tGuh7HbsxMbkTxsPLDBlWLzvQYPGN/o8eoS+9Ki7ns5V3Qt9aQmuqsc36Eb5miFPRTYXu1YxQSQs\n\tsOb3snArbGsFYp/tv8wwq5EUN4GFFLpt7ab/kYFDG5gIX6NIW46tQTj4iDwuCUtx0K88fRc/na3\n\tcFkw/m2wxFq26bOFzdFp0s1ynMsrz1QlOS7G/XNoDl7At6OeGNLxTJq/eE/7V3JCSGg6Ag22qW8\n\tmuLlxUxmmMm/Otn06zPGQZijW3JHf/P5j9kYLI48tCc+aoIIw=",
        "X-Received": "by 2002:a17:903:284:b0:2b2:5822:7a70 with SMTP id\n d9443c01a7336-2b2d5a63d4dmr223583195ad.38.1776272439043;\n        Wed, 15 Apr 2026 10:00:39 -0700 (PDT)",
        "From": "Guangshuo Li <lgs201920130244@gmail.com>",
        "To": "Miquel Raynal <miquel.raynal@bootlin.com>,\n\tRichard Weinberger <richard@nod.at>,\n\tVignesh Raghavendra <vigneshr@ti.com>,\n\tLinus Walleij <linusw@kernel.org>,\n\tGuangshuo Li <lgs201920130244@gmail.com>,\n\tDavid Woodhouse <David.Woodhouse@intel.com>,\n\tH Hartley Sweeten <hartleys@visionengravers.com>,\n\tlinux-mtd@lists.infradead.org,\n\tlinux-kernel@vger.kernel.org",
        "Cc": "stable@vger.kernel.org",
        "Subject": "[PATCH] mtd: maps: physmap: fix reference leak on failed device\n registration",
        "Date": "Thu, 16 Apr 2026 01:00:27 +0800",
        "Message-ID": "<20260415170027.3593563-1-lgs201920130244@gmail.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260415_100040_638382_5E21ECCE ",
        "X-CRM114-Status": "GOOD (  14.61  )",
        "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:  When platform_device_register() fails in physmap_init(),\n the\n    embedded struct device in physmap_flash has already been initialized by\n device_initialize(),\n    but the failure path only unregisters the plat [...]\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:62b 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.0 FROM_LOCAL_DIGITS      From: localpart has long digit sequence\n  0.0 FROM_LOCAL_HEX         From: localpart has long hexadecimal sequence\n  0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in\n                             digit\n                             [lgs201920130244(at)gmail.com]\n  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail\n provider\n                             [lgs201920130244(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": "When platform_device_register() fails in physmap_init(), the embedded\nstruct device in physmap_flash has already been initialized by\ndevice_initialize(), but the failure path only unregisters the platform\ndriver and does not drop the device reference for the current platform\ndevice:\n\n  physmap_init()\n    -> platform_device_register(&physmap_flash)\n       -> device_initialize(&physmap_flash.dev)\n       -> setup_pdev_dma_masks(&physmap_flash)\n       -> platform_device_add(&physmap_flash)\n\nThis leads to a reference leak when platform_device_register() fails.\nFix this by calling platform_device_put() before unregistering the\nplatform driver.\n\nThe issue was identified by a static analysis tool I developed and\nconfirmed by manual review.\n\nFixes: 1ca5d2f0196cf (\"mtd/maps/physmap: catch failure to register MTD_PHYSMAP_COMPAT device\")\nCc: stable@vger.kernel.org\nSigned-off-by: Guangshuo Li <lgs201920130244@gmail.com>\n---\n drivers/mtd/maps/physmap-core.c | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/mtd/maps/physmap-core.c b/drivers/mtd/maps/physmap-core.c\nindex 0dcc25b7ff98..6299a741e65b 100644\n--- a/drivers/mtd/maps/physmap-core.c\n+++ b/drivers/mtd/maps/physmap-core.c\n@@ -659,8 +659,10 @@ static int __init physmap_init(void)\n #ifdef CONFIG_MTD_PHYSMAP_COMPAT\n \tif (err == 0) {\n \t\terr = platform_device_register(&physmap_flash);\n-\t\tif (err)\n+\t\tif (err) {\n+\t\t\tplatform_device_put(&physmap_flash);\n \t\t\tplatform_driver_unregister(&physmap_flash_driver);\n+\t\t}\n \t}\n #endif\n \n",
    "prefixes": []
}