Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2195269/?format=api
{ "id": 2195269, "url": "http://patchwork.ozlabs.org/api/patches/2195269/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260210-ofnode-to-fdt-null-v1-1-4bed28680f35@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": "<20260210-ofnode-to-fdt-null-v1-1-4bed28680f35@bootlin.com>", "list_archive_url": null, "date": "2026-02-10T16:29:01", "name": "dm: core: Don't allow ofnode_to_fdt() to return NULL", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "8653ee24f21218cb32e4e154d606b8a588e09938", "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/20260210-ofnode-to-fdt-null-v1-1-4bed28680f35@bootlin.com/mbox/", "series": [ { "id": 491705, "url": "http://patchwork.ozlabs.org/api/series/491705/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=491705", "date": "2026-02-10T16:29:01", "name": "dm: core: Don't allow ofnode_to_fdt() to return NULL", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/491705/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2195269/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2195269/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=XtQz5S9p;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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=\"XtQz5S9p\";\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\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\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 4f9Rpf4q9lz1xtr\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 11 Feb 2026 03:29:14 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id B15E783CBD;\n\tTue, 10 Feb 2026 17:29:11 +0100 (CET)", "by phobos.denx.de (Postfix, from userid 109)\n id 1189683CE3; Tue, 10 Feb 2026 17:29:11 +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 F3D318367F\n for <u-boot@lists.denx.de>; Tue, 10 Feb 2026 17:29:08 +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 7DE504E40BFD\n for <u-boot@lists.denx.de>; Tue, 10 Feb 2026 16:29:08 +0000 (UTC)", "from mail.galae.net (mail.galae.net [212.83.136.155])\n by smtpout-01.galae.net (Postfix) with ESMTPS id 3A259606BD;\n Tue, 10 Feb 2026 16:29:08 +0000 (UTC)", "from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon)\n with ESMTPSA id C00A510B92008; Tue, 10 Feb 2026 17:29:04 +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=1770740947; h=from:subject:date:message-id:to:cc:mime-version:content-type:\n content-transfer-encoding; bh=mKymJRuZ61AWtYQqVbP3HLpXlGlbDKXfzs8Y7yVub7s=;\n b=XtQz5S9pnOR9X85DAr0Zd02g3IMZWQEHHkaMDXLU3+c1OdeFfrb9fR8oaZtJ8AQzZG7dxh\n vU3G6lAqT3iNrgQGEkATcEXv9BjpVsEMHg90nYhlQ8bG+pcRRLdPG+57odaqgWV7cAidIV\n ABhlX672LtIfwx25c/sgjOAe7rZO8fDC5ko/Da32rIMpA+kbIkx9WonhVZkYK2Nvfqgu0P\n 14s1jgPVtWwMuUpSETPLMDhs4TE473frSjF2S6xQL1yQtJq6NbBwEhpuZ7Xc9IJWRQrsoE\n beKYRQExxd5ssmCj4smKg/myT7Ep21noqag8WbRagk6md0tTw7NbUgFaw79j5w==", "From": "Romain Gantois <romain.gantois@bootlin.com>", "Date": "Tue, 10 Feb 2026 17:29:01 +0100", "Subject": "[PATCH] 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": "7bit", "Message-Id": "<20260210-ofnode-to-fdt-null-v1-1-4bed28680f35@bootlin.com>", "X-B4-Tracking": "v=1; b=H4sIAMxci2kC/x3MTQqAIBBA4avErBtQox+7SrSIHGsgNLQiEO+et\n PwW7yWIFJgijFWCQA9H9q5A1hWs++I2QjbFoITqhJICvXXeEF4erbnQ3ceBul20bdp+kJqghGc\n gy+8/neacPzpITvlkAAAA", "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\nSigned-off-by: Romain Gantois <romain.gantois@bootlin.com>\n---\n drivers/core/ofnode.c | 13 +++++++++----\n 1 file changed, 9 insertions(+), 4 deletions(-)\n\n\n---\nbase-commit: b99da05e1538b8fa153322da82917af2aa27e1d6\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..af24a2c533c 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 = 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": [] }