Show a patch.

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

{
    "id": 22546,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/22546/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/22546/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20250113202843.843466-1-chenghaoyang@chromium.org>",
    "date": "2025-01-13T20:28:38",
    "name": "[v2] DmaBufAllocator: Avoid syncing with an invalid file descriptor",
    "commit_ref": "4dad8ece72c0c1c6c9e0101f4c31937bd739d001",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "a188dfc3fb2e2dfe40643cb28dc561424a3e9d79",
    "submitter": {
        "id": 117,
        "url": "https://patchwork.libcamera.org/api/1.1/people/117/?format=api",
        "name": "Cheng-Hao Yang",
        "email": "chenghaoyang@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/22546/mbox/",
    "series": [
        {
            "id": 4948,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4948/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4948",
            "date": "2025-01-13T20:28:38",
            "name": "[v2] DmaBufAllocator: Avoid syncing with an invalid file descriptor",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/4948/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/22546/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/22546/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 808D5C326C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 13 Jan 2025 20:28:53 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3B1AB68541;\n\tMon, 13 Jan 2025 21:28:53 +0100 (CET)",
            "from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com\n\t[IPv6:2607:f8b0:4864:20::102b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B048B684E7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Jan 2025 21:28:51 +0100 (CET)",
            "by mail-pj1-x102b.google.com with SMTP id\n\t98e67ed59e1d1-2efe25558ddso5967917a91.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Jan 2025 12:28:51 -0800 (PST)",
            "from chenghaoyang-low.c.googlers.com.com\n\t(21.160.199.104.bc.googleusercontent.com. [104.199.160.21])\n\tby smtp.gmail.com with ESMTPSA id\n\t98e67ed59e1d1-2f5593d0911sm9074143a91.8.2025.01.13.12.28.48\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 13 Jan 2025 12:28:49 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"bRB2Tp8f\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1736800130; x=1737404930;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc:subject:date:message-id:reply-to;\n\tbh=O7QZRjL37SiHN0EP1f1IRNNfKjFjt5+Xrwt6hRmT81Y=;\n\tb=bRB2Tp8fXllepo11z58eFSccXpi0QfNVv/6o0Db0er0LOv3xFiwQqvG0dCcRryM0xb\n\tuXkidmA5gm/EIvVPQKE1IGhbBZN/YVmG72DAz3qbhkp3imttuPBK3c71u2QvGu84GGDj\n\twnfhspD7VPaDBpeXS8X84drkoh/VOPgW/tRvU=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1736800130; x=1737404930;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=O7QZRjL37SiHN0EP1f1IRNNfKjFjt5+Xrwt6hRmT81Y=;\n\tb=i7O3Pmi9kaLPuX0WdJDT71PlGF07y629S8P97GaJwK2EpLm3FBc8jB1rZNz+SmKZJl\n\tIdUlCyzo0nyxyVvbYTlXbV/a8mbPh6TVAwfbXf1jFkv2E4Rda0S2d8bW0Zm/AJpR9w7r\n\tAiBZymtdh4+aRYJy60cuf583fSnmfNEN3nh2oSfcmFGRwiY3sjjlWVuysvT1y+J24tBu\n\tWg9CyPHjOlokvapZR5+KPT7KI1MQg8DzKRLOYv17Q/ZT2ib921bdhizgNuArVtEG/BZz\n\t51REK6onQf+QKqHc3oz1xJKoudHCCIskhCcz+ftlkfRUgBCLFmqdlsfUI6HEyiNdiWVm\n\t0vIA==",
        "X-Gm-Message-State": "AOJu0Yx4H9v34FwGSedELNnCgsShCkWYZ0pIHNie7s3y/VzhiAHz0Wll\n\tuJEJu32TKhvqpo9VUIVgHFs+0twey5x+zMhsPJrbyfa5jkDcEhkvQGKReMaLWAgQ0pcEKEDaQEv\n\t++A==",
        "X-Gm-Gg": "ASbGncv7HlKX8GJbpkLQr/IBkhWRqbOhkdBCSyrkqGM+GCujlAblxbT0fKKODZBwfHA\n\tOs4Q29HDTBmHDVe/Al0bLbkrQAO2hCw+hfAkzVq7OsaMx4GEzzpsvnkZlwIOTIgnCQYHU+OakZM\n\toJqaPY8gGuYcQskhVNcWhDb+6x9xPg0IHo4KfNWb+9Yjr8sc6hiXyFA2/fFkD36jNhoYT+qlzzN\n\tn5cqSFg1U3A+MMpSEW1o5785xdHd/douaHAIAN2gj8wdceS4M92uTjs20dK/qYQ8TOAhEMfc0Ui\n\tPXE9GJulEfOI07SbdRDFc0/7n29ooYOlpXyWV70cfuwLmMPfKNRBOEP1LrZgyJ0=",
        "X-Google-Smtp-Source": "AGHT+IFc43cCY6vUvfmjhfciTS6Sgu7pOpnDGzAAket7KOnbJ/HPScAzks2xFEux70fERea2u5sa+A==",
        "X-Received": "by 2002:a17:90b:258b:b0:2ee:ab04:1037 with SMTP id\n\t98e67ed59e1d1-2f548ec788amr36264578a91.17.1736800129879; \n\tMon, 13 Jan 2025 12:28:49 -0800 (PST)",
        "From": "Harvey Yang <chenghaoyang@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Harvey Yang <chenghaoyang@chromium.org>,\n\tMilan Zamazal <mzamazal@redhat.com>",
        "Subject": "[PATCH v2] DmaBufAllocator: Avoid syncing with an invalid file\n\tdescriptor",
        "Date": "Mon, 13 Jan 2025 20:28:38 +0000",
        "Message-ID": "<20250113202843.843466-1-chenghaoyang@chromium.org>",
        "X-Mailer": "git-send-email 2.47.1.688.g23fc6f90ad-goog",
        "MIME-Version": "1.0",
        "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": "As DmaSyncer disables the copy c'tor, the move c'tor will be used\ninstead. This leaves some DmaSyncers with invalid SharedFDs. They should\navoid syncing with invalid file descriptors in the d'tor.\n\nFixes: 545046a41e17 (\"DmaBufAllocator: Make DmaSyncer non-copyable\")\nSigned-off-by: Harvey Yang <chenghaoyang@chromium.org>\nTested-by: Milan Zamazal <mzamazal@redhat.com>\n---\n src/libcamera/dma_buf_allocator.cpp | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/libcamera/dma_buf_allocator.cpp b/src/libcamera/dma_buf_allocator.cpp\nindex a014c3b4263c..d8c62dd67a96 100644\n--- a/src/libcamera/dma_buf_allocator.cpp\n+++ b/src/libcamera/dma_buf_allocator.cpp\n@@ -325,7 +325,12 @@ DmaSyncer::DmaSyncer(SharedFD fd, SyncType type)\n \n DmaSyncer::~DmaSyncer()\n {\n-\tsync(DMA_BUF_SYNC_END);\n+\t/*\n+\t * DmaSyncer might be moved and left with an empty SharedFD.\n+\t * Avoid syncing with an invalid file descriptor in this case.\n+\t */\n+\tif (fd_.isValid())\n+\t\tsync(DMA_BUF_SYNC_END);\n }\n \n void DmaSyncer::sync(uint64_t step)\n",
    "prefixes": [
        "v2"
    ]
}