get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2196393,
    "url": "http://patchwork.ozlabs.org/api/patches/2196393/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260213092930.1.I77c3eb563271c21870379eefd16ebbc4e09635bb@changeid/",
    "project": {
        "id": 42,
        "url": "http://patchwork.ozlabs.org/api/projects/42/?format=api",
        "name": "Linux GPIO development",
        "link_name": "linux-gpio",
        "list_id": "linux-gpio.vger.kernel.org",
        "list_email": "linux-gpio@vger.kernel.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260213092930.1.I77c3eb563271c21870379eefd16ebbc4e09635bb@changeid>",
    "list_archive_url": null,
    "date": "2026-02-13T17:29:31",
    "name": "gpio: Avoid NULL dereference in linehandle_create()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "cc7b900354120ff3ecf80441ba7504ce9243cd0c",
    "submitter": {
        "id": 9763,
        "url": "http://patchwork.ozlabs.org/api/people/9763/?format=api",
        "name": "Douglas Anderson",
        "email": "dianders@chromium.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260213092930.1.I77c3eb563271c21870379eefd16ebbc4e09635bb@changeid/mbox/",
    "series": [
        {
            "id": 492124,
            "url": "http://patchwork.ozlabs.org/api/series/492124/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=492124",
            "date": "2026-02-13T17:29:31",
            "name": "gpio: Avoid NULL dereference in linehandle_create()",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/492124/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2196393/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2196393/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-gpio+bounces-31672-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-gpio@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256\n header.s=google header.b=dTWwyw7s;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-gpio+bounces-31672-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org\n header.b=\"dTWwyw7s\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=74.125.82.52",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=chromium.org",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=chromium.org"
        ],
        "Received": [
            "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fCK1f3mxjz1xvQ\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 14 Feb 2026 04:30:14 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id C16923037D49\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 13 Feb 2026 17:30:12 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 7D13F364EAF;\n\tFri, 13 Feb 2026 17:30:12 +0000 (UTC)",
            "from mail-dl1-f52.google.com (mail-dl1-f52.google.com\n [74.125.82.52])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 0DB2226FA77\n\tfor <linux-gpio@vger.kernel.org>; Fri, 13 Feb 2026 17:30:10 +0000 (UTC)",
            "by mail-dl1-f52.google.com with SMTP id\n a92af1059eb24-126ea4b77adso1564063c88.1\n        for <linux-gpio@vger.kernel.org>;\n Fri, 13 Feb 2026 09:30:10 -0800 (PST)",
            "from dianders.sjc.corp.google.com\n ([2a00:79e0:2e7c:8:d300:8e6:51e6:35df])\n        by smtp.gmail.com with ESMTPSA id\n a92af1059eb24-1272a6f3279sm6371734c88.13.2026.02.13.09.30.08\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Fri, 13 Feb 2026 09:30:09 -0800 (PST)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1771003812; cv=none;\n b=e+b8d56LLbW1rbSSzeBilz9SFau/AeZz5GFmpq3LDspSAetveDGzAjKaMMXqwkn9Gd96Br7nLYD998h1x2IoFsVikLzjG0m0kokkrDGkizq+wYw8J6gaFwZ3SmsMCQkdL32mnCC06sPaVujZxCBMZgjKvuT0AgTHvn8lGBdoUoU=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1771003812; c=relaxed/simple;\n\tbh=WDpgVOjoeYeHT6XPv+D0d1AKL30ZR6kb6R6gZTPOiTs=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=VppnfcZLFkfwEkeKodw7erRsiBeO0jqhpf7XUSvQGgHV6HYuPfCxRcelPjLcKaz18ojXQmhVBx1/gmIW0qVcqm5vTdvVyGLHCzU8JLdu4Rb1jYP6ZleJyg0V+tD4yQ+FQoq8ARWwC3Hg6fr3xStvLvJzo3N5phRj+6wFlPuiLjU=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=chromium.org;\n spf=pass smtp.mailfrom=chromium.org;\n dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org\n header.b=dTWwyw7s; arc=none smtp.client-ip=74.125.82.52",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=chromium.org; s=google; t=1771003810; x=1771608610;\n darn=vger.kernel.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=f3h5s84pc9sdsF/HPUvnkVB8yJ6ZEzaEy6blo4kvSbk=;\n        b=dTWwyw7sT00yQO6kk/rYMOU323g0Br3kSZm5dlzdLaKbC/ybFMgzLjOfaITiJ7H1T6\n         fq/2dBKCz72xAyWXOCTnTXvjf2WYvKk5o6+bpudN1D1zm8ev10oA4HZghPfNBZmbXlHa\n         3xJpauiKbKXIgG4POuZ0yWx8dWaMPXNuElyhY=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20230601; t=1771003810; x=1771608610;\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=f3h5s84pc9sdsF/HPUvnkVB8yJ6ZEzaEy6blo4kvSbk=;\n        b=jaiq0co+lQCNvHjIulBXXHxhfi7mrB/d7V/vcRt9VpEbtIqmOS+DmCSqueIXd+/2Iu\n         xOFEOxulNgGyXRB3Lw26v/TJ2rmMgkRWSNbjsekLOsTnShGojmMzeos71ohseRz89gsr\n         Pa6RoENIqkrEH/NBqwTMQe9jCo5goukxmlWbEPnkeeEfbLIp1OR0ja+40ySrj1KMl5bW\n         5ksNYJjpe+VGuk3G7ro68WjRSGiia2Vw4AtLaiVbxR4YqkYRjkLGNZ0w3EE+wT7gsori\n         Y1EFuep18frowtO6RmIxWSkFPfAiA2J6z3Vao2uaPbNoGudniJdzb2Ffns7IEsExbdZx\n         Dgng==",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCX/2n80Gi2U2il5dchs3v+xFHtQS45CurCQ4B6mUI1r71b+sJQDkt1535d2dRsnUbOvHOrQBzsmZOTd@vger.kernel.org",
        "X-Gm-Message-State": "AOJu0YzYxFzMVeqe4Eo1OIRZMEOmuqOHCeYpzU3ZLpnpQQKbkA4/bFWq\n\ttoJsILj7o2oabio27IiToLw1lLpqX531WTIvUkVk/yIx2oEcm54t91lGVo/gcwOqHA==",
        "X-Gm-Gg": "AZuq6aKr42ft5woYb03P+8FFhMFZiVrVSkUlAB+1GPeGedZjsj6y/DtI3lKnqfekGKM\n\tcDIZO6UEkAIGDpeRwKaAizy/E1xbOo4h3d8hyjAVdIjCEqjRrpC1KkmghjmmQ3Bc00mlVC88rqq\n\t5dNR9HS6HokhN7HuWlxanoOLk9Xcvpgl6NZcDmKgMbMVvk9FCqes4c5Xg9PYdPM491X7hU52DRX\n\tYhGpNnRnLnRAWWpTj+6hZVZgrUMQqxXhIg6KKaDNG0jjWlcPpcOa/As62KvkC+MIV5PBGc2YXRX\n\tAHmOjkuxNThv8CdA8nFB+mE0BfjXGPcCfc+sJziUPFEpIFXKqBES+PuRoGH1pxkgz20cfa734Tp\n\t8oMI0DDavWLRVPUGXBya9yOCeKt7/0WmZWBbxUOcg44zVSTrENuDtBYene4GPhlnbE6DC/u8eaa\n\tN2iGcsXsRFdY5nFKHuul3zRxsgq2F8wfokVlgu05dQoW2PnC1SB5sBQnQy0C2oGOvprBagX6zy+\n\tbLb42yjiA==",
        "X-Received": "by 2002:a05:7022:62a0:b0:11f:2c69:31 with SMTP id\n a92af1059eb24-12739850ed5mr1526056c88.46.1771003810033;\n        Fri, 13 Feb 2026 09:30:10 -0800 (PST)",
        "From": "Douglas Anderson <dianders@chromium.org>",
        "To": "Linus Walleij <linusw@kernel.org>,\n\tChristian Brauner <brauner@kernel.org>,\n\tBartosz Golaszewski <brgl@kernel.org>,\n\tKent Gibson <warthog618@gmail.com>",
        "Cc": "Douglas Anderson <dianders@chromium.org>,\n\tlinux-gpio@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org",
        "Subject": "[PATCH] gpio: Avoid NULL dereference in linehandle_create()",
        "Date": "Fri, 13 Feb 2026 09:29:31 -0800",
        "Message-ID": "\n <20260213092930.1.I77c3eb563271c21870379eefd16ebbc4e09635bb@changeid>",
        "X-Mailer": "git-send-email 2.53.0.273.g2a3d683680-goog",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-gpio@vger.kernel.org",
        "List-Id": "<linux-gpio.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-gpio+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-gpio+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit"
    },
    "content": "In linehandle_create(), there is a statement like this:\n  retain_and_null_ptr(lh);\n\nSoon after, there is a debug printout that dereferences \"lh\", which\nwill crash things.\n\nAvoid the crash by reading value needed by the printout before making\n\"lh\" NULL.\n\nFixes: da7e394bf58f (\"gpio: convert linehandle_create() to FD_PREPARE()\")\nSigned-off-by: Douglas Anderson <dianders@chromium.org>\n---\n\n drivers/gpio/gpiolib-cdev.c | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c\nindex 2adc3c070908..13ab6a5ebb76 100644\n--- a/drivers/gpio/gpiolib-cdev.c\n+++ b/drivers/gpio/gpiolib-cdev.c\n@@ -304,6 +304,7 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip)\n {\n \tstruct gpiohandle_request handlereq;\n \tstruct linehandle_state *lh __free(linehandle_free) = NULL;\n+\tu32 num_descs;\n \tint i, ret;\n \tu32 lflags;\n \n@@ -379,6 +380,7 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip)\n \t\t\t\t      lh, O_RDONLY | O_CLOEXEC));\n \tif (fdf.err)\n \t\treturn fdf.err;\n+\tnum_descs = lh->num_descs;\n \tretain_and_null_ptr(lh);\n \n \thandlereq.fd = fd_prepare_fd(fdf);\n@@ -388,7 +390,7 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip)\n \tfd_publish(fdf);\n \n \tdev_dbg(&gdev->dev, \"registered chardev handle for %d lines\\n\",\n-\t\tlh->num_descs);\n+\t\tnum_descs);\n \n \treturn 0;\n }\n",
    "prefixes": []
}