Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2197168/?format=api
{ "id": 2197168, "url": "http://patchwork.ozlabs.org/api/patches/2197168/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260217-ofnode-to-fdt-null-v2-1-915e627d201b@bootlin.com/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260217-ofnode-to-fdt-null-v2-1-915e627d201b@bootlin.com>", "list_archive_url": null, "date": "2026-02-17T09:27:52", "name": "[v2] dm: core: Don't allow ofnode_to_fdt() to return NULL", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "c5b09b290ed7c33708fcc0450359ae47e4ef6d95", "submitter": { "id": 87420, "url": "http://patchwork.ozlabs.org/api/people/87420/?format=api", "name": "Romain Gantois", "email": "romain.gantois@bootlin.com" }, "delegate": { "id": 3651, "url": "http://patchwork.ozlabs.org/api/users/3651/?format=api", "username": "trini", "first_name": "Tom", "last_name": "Rini", "email": "trini@ti.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260217-ofnode-to-fdt-null-v2-1-915e627d201b@bootlin.com/mbox/", "series": [ { "id": 492401, "url": "http://patchwork.ozlabs.org/api/series/492401/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=492401", "date": "2026-02-17T09:27:52", "name": "[v2] dm: core: Don't allow ofnode_to_fdt() to return NULL", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/492401/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2197168/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2197168/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "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 unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256\n header.s=dkim header.b=evP79hMi;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)", "phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=bootlin.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=bootlin.com header.i=@bootlin.com header.b=\"evP79hMi\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=bootlin.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=romain.gantois@bootlin.com" ], "Received": [ "from phobos.denx.de (phobos.denx.de [85.214.62.61])\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 4fFZ7Y21Rkz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 17 Feb 2026 20:28:09 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 2D42483C32;\n\tTue, 17 Feb 2026 10:28:06 +0100 (CET)", "by phobos.denx.de (Postfix, from userid 109)\n id 733B083C61; Tue, 17 Feb 2026 10:28:04 +0100 (CET)", "from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 475178063E\n for <u-boot@lists.denx.de>; Tue, 17 Feb 2026 10:28:01 +0100 (CET)", "from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233])\n by smtpout-03.galae.net (Postfix) with ESMTPS id ACC594E40EF7;\n Tue, 17 Feb 2026 09:28:00 +0000 (UTC)", "from mail.galae.net (mail.galae.net [212.83.136.155])\n by smtpout-01.galae.net (Postfix) with ESMTPS id 789BB606D1;\n Tue, 17 Feb 2026 09:28:00 +0000 (UTC)", "from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon)\n with ESMTPSA id 73A4B10368945; Tue, 17 Feb 2026 10:27:57 +0100 (CET)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,\n SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim;\n t=1771320479; h=from:subject:date:message-id:to:cc:mime-version:content-type:\n content-transfer-encoding; bh=yJGomfxQTxejRa9DS/2OpPxmIQgsHLeQboKCBeMID10=;\n b=evP79hMiR7yV7ga1oFtaF0wiRrm5zoqsidvoGhazxZsGdD+iSRnnTXrs1h1gCVSVaRu0Xl\n E2doP2ziRpAb+expphD0KuwXwPNeTUH+zdToBCxBr2kwjrCkVt0rdqCkI1Yudh7E0mWEZU\n dyashwoeiR7I3faby5aqzZ9snjj5NnKxLX4GSv/WxjRWoMmvoewGY2scNYT70/SF5FNCmb\n pQxlRU9Yaq8Ovfr/+QmzWfZuCYiH+rp9mrtElvwkfknQuEyUAIJKPwCZnSjxgpIgyXZ2pL\n TfGR0gXhmidEGVxFXML1FKVKUf5yOp0uJJonT1lUPo1YWdgzYULVid55fP9qCg==", "From": "Romain Gantois <romain.gantois@bootlin.com>", "Date": "Tue, 17 Feb 2026 10:27:52 +0100", "Subject": "[PATCH v2] dm: core: Don't allow ofnode_to_fdt() to return NULL", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "8bit", "Message-Id": "<20260217-ofnode-to-fdt-null-v2-1-915e627d201b@bootlin.com>", "X-B4-Tracking": "v=1; b=H4sIAJc0lGkC/32NQQ6CMBBFr0Jm7Zi2CoIr72FYAJ3KJNghbSUaw\n t2tHMDle8l/f4VIgSnCtVgh0MKRxWcwhwKGsfMPQraZwShTKaMVivNiCZOgswn9a5qwKbvGncp\n LrRuCPJwDOX7v0XubeeSYJHz2j0X/7N/colHjuSdr6qpWOXzrRdLE/jjIE9pt276thxmgtgAAA\n A==", "X-Change-ID": "20260210-ofnode-to-fdt-null-95a9f357819e", "To": "u-boot@lists.denx.de", "Cc": "Thomas Petazzoni <thomas.petazzoni@bootlin.com>,\n Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,\n Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,\n Yannick Fertre <yannick.fertre@foss.st.com>,\n Andrew Goodbody <andrew.goodbody@linaro.org>,\n Patrice Chotard <patrice.chotard@foss.st.com>,\n Romain Gantois <romain.gantois@bootlin.com>", "X-Mailer": "b4 0.14.3", "X-Last-TLS-Session-Version": "TLSv1.3", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.39", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>", "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de", "X-Virus-Status": "Clean" }, "content": "The ofnode_to_fdt() function may return a NULL pointer in multiple cases.\nOr, this function's return value is often passed directly to functions such\nas fdt_getprop() which end up dereferencing it, thus causing a NULL pointer\nexception.\n\nDon't allow ofnode_to_fdt() to return NULL, to avoid a NULL pointer\ndereference.\n\nReviewed-by: Raphaël Gallais-Pou <raphael.gallais-pou@foss.st.com>\nSigned-off-by: Romain Gantois <romain.gantois@bootlin.com>\n---\nChanges in v2:\n- Added back a dropped cast from cont void* to void*\n- Link to v1: https://lore.kernel.org/r/20260210-ofnode-to-fdt-null-v1-1-4bed28680f35@bootlin.com\n---\n drivers/core/ofnode.c | 13 +++++++++----\n 1 file changed, 9 insertions(+), 4 deletions(-)\n\n\n---\nbase-commit: 8666b16015d4212facacc514e2eb626f3630dcf0\nchange-id: 20260210-ofnode-to-fdt-null-95a9f357819e\n\nBest regards,", "diff": "diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c\nindex cf1cf8abfbe..3a36b6fdd03 100644\n--- a/drivers/core/ofnode.c\n+++ b/drivers/core/ofnode.c\n@@ -164,15 +164,20 @@ void *ofnode_lookup_fdt(ofnode node)\n \n void *ofnode_to_fdt(ofnode node)\n {\n+\tvoid *fdt;\n+\n #ifdef OF_CHECKS\n \tif (of_live_active())\n-\t\treturn NULL;\n+\t\tpanic(\"%s called with live tree in use!\\n\", __func__);\n #endif\n \tif (CONFIG_IS_ENABLED(OFNODE_MULTI_TREE) && ofnode_valid(node))\n-\t\treturn ofnode_lookup_fdt(node);\n+\t\tfdt = ofnode_lookup_fdt(node);\n+\telse\n+\t\tfdt = (void *)gd->fdt_blob;\n+\n+\tassert(fdt);\n \n-\t/* Use the control FDT by default */\n-\treturn (void *)gd->fdt_blob;\n+\treturn fdt;\n }\n \n /**\n", "prefixes": [ "v2" ] }