get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2232306,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2232306/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/6717e0b2a6244ee4e691dba03eb8c790c202e89e.1777889235.git.vebohr@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": "<6717e0b2a6244ee4e691dba03eb8c790c202e89e.1777889235.git.vebohr@gmail.com>",
    "date": "2026-05-04T10:08:45",
    "name": "[3/5] mtd: maps: physmap: fix reference leak on failed device registration",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "c1b5aeae1245e3e44082517c592761f5fc6c30b2",
    "submitter": {
        "id": 93224,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/93224/?format=api",
        "name": "Vastargazing",
        "email": "vebohr@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/6717e0b2a6244ee4e691dba03eb8c790c202e89e.1777889235.git.vebohr@gmail.com/mbox/",
    "series": [
        {
            "id": 502636,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/502636/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=502636",
            "date": "2026-05-04T10:08:45",
            "name": null,
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/502636/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2232306/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2232306/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=mX1rN1ad;\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=ozVR4AHC;\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 4g8HS21ngXz1yJ9\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 04 May 2026 20:09:18 +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 1wJqEW-0000000Csqy-17nM;\n\tMon, 04 May 2026 10:09:00 +0000",
            "from mail-lf1-x135.google.com ([2a00:1450:4864:20::135])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wJqET-0000000CsqG-0CJu\n\tfor linux-mtd@lists.infradead.org;\n\tMon, 04 May 2026 10:08:58 +0000",
            "by mail-lf1-x135.google.com with SMTP id\n 2adb3069b0e04-5a865004748so1927995e87.0\n        for <linux-mtd@lists.infradead.org>;\n Mon, 04 May 2026 03:08:55 -0700 (PDT)",
            "from va-HP-Pavilion-Desktop-595-p0xxx.mshome.net ([193.0.150.248])\n        by smtp.gmail.com with ESMTPSA id\n 2adb3069b0e04-5a86645ae7csm1979099e87.79.2026.05.04.03.08.53\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Mon, 04 May 2026 03:08:53 -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:References:In-Reply-To:\n\tMessage-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=V817Q+/Dtv40piwi0mnqrhGynfHehlKL9oEIvExe2XQ=; b=mX1rN1admAKu+W\n\t2ooCLu3DRjQlWHrVVn95EpqkNAyHVVmwUw2Ae30PKfVF+ykeKX6XK++voTr5f8hbFNC4NIi2tEnKP\n\tNM/KDPhcLEMBzZDcukd8igr01oTM2it2Y7op3SffDjwQgRO/3ujwwd/3mIxGEN74GPiljxnZWDDWn\n\tMh1Pten2fJ9OI90Mk4krGJ3lmO56VMJo92louk63mxTE+4H+gJz4eUE74QyxXssUajtp+wR52FNSu\n\tGQNG55ZQmTE0JGr2cn+2V+8AnzcCUuAioOUJjbBCtKIV0PWM8wqZNUjh1Q62ZBYQWW1Vg6kOnoV9a\n\tOYCeibhOJ7UAXUDQOokA==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1777889334; x=1778494134;\n darn=lists.infradead.org;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=rmNwLKC44+y7Cqt7OcmRZ9UY7ReRqF1/k1kRQnz8QNY=;\n        b=ozVR4AHC9vtU4hvxBVpxJoqF8VdFKYDeHfYnayKsnBmuYzUeceB0n+6Dc/T+t7DCtM\n         VJ0BS0D1h8TMEkc6ydoCmizW86dvfE8/1zBm2oEbO9YsOcomEjZplUEFqTjy5zMIvS5h\n         I6D90rr9hushj0YqM4o/RcoPYB8rPNPZHYElyhrUtLGZiV4ystTVrIvd6tFTowV5afgv\n         oih8UYXI27Y91XLWr1z1YtciS7hCAkw+J0s5ahftbe6bSGyVIWSFuggdL853Z59rIx7N\n         IUXQY7Q/rc17Jb3y2R3GakhN/F6a8Y9IVLQ1PCfC4HT85tlYGglAMg/fwnIeEoOhV1jV\n         aw3Q=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1777889334; x=1778494134;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=rmNwLKC44+y7Cqt7OcmRZ9UY7ReRqF1/k1kRQnz8QNY=;\n        b=Bn18CsPz04jF3u3qW2GAGO5a213dWY1YyKWe7R3uHnZbBsAfDMXW8HEEgUJ26e0H/4\n         oKqto1PCrUNGFoQdD5mjSWLNi6bV1Mnx7ewfwf7IcfuXoczYO/gvylRdXG1e8L5/dby7\n         JHntUqEHV8cKPih6WgAbH9UP6slmE2U3yDKCYN4Y7qh6rNr+FugA2hcxk6f486W6dwfD\n         tSiFHyKC16nn9Rz8ZnMuiq4ZN9yKkNEUggBc7nz1smIRi524wrsp1g8P6e2A1NiO2fuW\n         +/Rm26U5Q7lFee4zjVR0aEIRF15Ot48sJo7pEd/XtyrIcwrxOKDnyUR6BUbcUHzbrVYY\n         3aRw==",
        "X-Forwarded-Encrypted": "i=1;\n AFNElJ8p8H/0grK6Yfsmzk41cA5R2X1gJZhjmifS1CoTpsRYfkg02YRqwzkJHQTTq9wZJ1X+pPAPncTWMqQ=@lists.infradead.org",
        "X-Gm-Message-State": "AOJu0YxIjceEhBg/0UO97ppkc9w2Iw+3k3BqsvLsW+xbY5PAok91Yi3i\n\tMgDJXujgKw+5tPTS2gdHWDCh+xC4KZ7eIPmMv+gHZ6CRSirC/QLhLrGmb1EV2s/DOYHNwZLFcV0\n\t=",
        "X-Gm-Gg": "AeBDiet3bIM4fOAJWc47vkc0p2v7/fsVGH7Y1Y3E323nFCiMbtn5gZSMTajJKRRgDgC\n\tCzZtB3Majd2iKW4YONONAUwzkUjhufpxnVhFWYaYd4LnKn+Wp8hHz2yG4F8ndqC5vJZ5bT5Ob+Q\n\tk5sVN5GENs+JEpnQ9pNTqHWEs62AXWdENkleHIiCKi6RUdBQhGCIZH+oj9OiaxV4opWdamPRB60\n\tqIGPeoCxiIV3YGWdDr6Oj+asC3APqMYINEIT6wjyREG8+fo+Qr3xQsSfeesBJaNu4g5FTtlIaTd\n\tXCVhoeFp6bRiYr70nS7ndhFf+ffqgIAldiKV3VWgL52DXZDeRUPVDOordiR2wpP3R0+bYVOGkR4\n\tUeUaD0a302eRA7MNqvecEcn6m6+cc7uf7oVTcG/wKOFzygMCUxY/6KL5t+xWwn7j7EovW24dmCl\n\tZMNJmmS04L6lbz5VaQIK+R7/14Y3p1OnsCqQWpLXZv6mq233OKN1XurtsZ8V5SzNDTL6uB96I=",
        "X-Received": "by 2002:a05:6512:2208:b0:5a2:c962:59f1 with SMTP id\n 2adb3069b0e04-5a86215f89emr2358405e87.16.1777889334019;\n        Mon, 04 May 2026 03:08:54 -0700 (PDT)",
        "From": "Vastargazing <vebohr@gmail.com>",
        "To": "linux-kernel@vger.kernel.org",
        "Cc": "Vastargazing <vebohr@gmail.com>,\n\tstable@vger.kernel.org,\n\tMiquel Raynal <miquel.raynal@bootlin.com>,\n\tRichard Weinberger <richard@nod.at>,\n\tVignesh Raghavendra <vigneshr@ti.com>,\n\tDavid Woodhouse <dwmw2@infradead.org>,\n\tLennert Buytenhek <buytenh@wantstofly.org>,\n\tlinux-mtd@lists.infradead.org",
        "Subject": "[PATCH 3/5] mtd: maps: physmap: fix reference leak on failed device\n registration",
        "Date": "Mon,  4 May 2026 13:08:45 +0300",
        "Message-ID": "\n <6717e0b2a6244ee4e691dba03eb8c790c202e89e.1777889235.git.vebohr@gmail.com>",
        "X-Mailer": "git-send-email 2.51.0",
        "In-Reply-To": "<cover.1777889235.git.vebohr@gmail.com>",
        "References": "<cover.1777889235.git.vebohr@gmail.com>",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260504_030857_233162_609F8C9A ",
        "X-CRM114-Status": "GOOD (  15.33  )",
        "X-Spam-Score": "-2.1 (--)",
        "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 has already been initialized by device_initialize()\n    inside platform_device_register(). The error path unregisters th [...]\n Content analysis details:   (-2.1 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                             [2a00:1450:4864:20:0:0:0:135 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_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 -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from\n                             envelope-from domain\n -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n                             [score: 0.0000]\n  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail\n provider\n                             [vebohr(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 has already been initialized by device_initialize() inside\nplatform_device_register(). The error path unregisters the driver but\nreturns without dropping the device reference:\n\n  physmap_init()\n    -> platform_device_register(&physmap_flash)\n       -> device_initialize(&physmap_flash.dev)   /* kref = 1 */\n       -> platform_device_add(&physmap_flash)     /* fails */\n    <- platform_driver_unregister() called, but kref still 1\n\nPer platform_device_register() kernel-doc:\n\n  NOTE: _Never_ directly free @pdev after calling this function, even if\n  it returned an error! Always use platform_device_put() to give up the\n  reference initialised in this function instead.\n\nFix this by calling platform_device_put() before unregistering the driver.\n\nFixes: 73566edf9b91 (\"[MTD] Convert physmap to platform driver\")\nCc: stable@vger.kernel.org\nAssisted-by: GitHub Copilot (Claude Sonnet 4.5)\nSigned-off-by: Vastargazing <vebohr@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 dcda7685fc99..45d79ca622c1 100644\n--- a/drivers/mtd/maps/physmap-core.c\n+++ b/drivers/mtd/maps/physmap-core.c\n@@ -654,8 +654,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": [
        "3/5"
    ]
}