Show a patch.

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

{
    "id": 23012,
    "url": "https://patchwork.libcamera.org/api/patches/23012/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/23012/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20250325140745.1400058-1-barnabas.pocze@ideasonboard.com>",
    "date": "2025-03-25T14:07:45",
    "name": "[v1] pipeline: rpi: Fix potential empty optional read",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "e6b28c53f24ceee297e86389e5fd1243067ce500",
    "submitter": {
        "id": 216,
        "url": "https://patchwork.libcamera.org/api/people/216/?format=api",
        "name": "Barnabás Pőcze",
        "email": "barnabas.pocze@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/23012/mbox/",
    "series": [
        {
            "id": 5078,
            "url": "https://patchwork.libcamera.org/api/series/5078/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5078",
            "date": "2025-03-25T14:07:45",
            "name": "[v1] pipeline: rpi: Fix potential empty optional read",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/5078/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/23012/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/23012/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 8B2EAC3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 25 Mar 2025 14:07:51 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5E4EF68952;\n\tTue, 25 Mar 2025 15:07:50 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 66B6B600EB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 25 Mar 2025 15:07:49 +0100 (CET)",
            "from pb-laptop.local (185.221.143.221.nat.pool.zt.hu\n\t[185.221.143.221])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0FCD982E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 25 Mar 2025 15:06:01 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"WYx8mR+p\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1742911562;\n\tbh=FhF7CCKEyiPE47i1r/Ns328oGIRuQyZ9stLEE8a9JZQ=;\n\th=From:To:Subject:Date:From;\n\tb=WYx8mR+p+UtEYiVp0KknUk4IhTV/iOnvqLww+1FOC5SdlmvNLx9GnmgaVIF6GePUa\n\tcz7xT15IXPhy76LjpB5oK0cXZ4ZV9G9MZx+tVq4PW0voBwslJ53D4XSvF1c2EjYhxL\n\tn8zipHcNuzQemx/htBBPs+fugpYzg2MmcpoxxgCM=",
        "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[PATCH v1] pipeline: rpi: Fix potential empty optional read",
        "Date": "Tue, 25 Mar 2025 15:07:45 +0100",
        "Message-ID": "<20250325140745.1400058-1-barnabas.pocze@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.49.0",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "If `!target`, then `*target` is undefined behaviour, so check if the optional\nis empty when printing the error message. Simplify the check as well.\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n src/libcamera/pipeline/rpi/vc4/vc4.cpp | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\n--\n2.49.0",
    "diff": "diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\nindex fd8d84b14..fe910bdf2 100644\n--- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n+++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n@@ -510,9 +510,9 @@ int Vc4CameraData::platformPipelineConfigure(const std::unique_ptr<YamlObject> &\n \t}\n\n \tstd::optional<std::string> target = (*root)[\"target\"].get<std::string>();\n-\tif (!target || *target != \"bcm2835\") {\n+\tif (target != \"bcm2835\") {\n \t\tLOG(RPI, Error) << \"Unexpected target reported: expected \\\"bcm2835\\\", got \"\n-\t\t\t\t<< *target;\n+\t\t\t\t<< (target ? target->c_str() : \"(unknown)\");\n \t\treturn -EINVAL;\n \t}\n\n",
    "prefixes": [
        "v1"
    ]
}