| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/06/29 09:26 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [
"platform_device_set_of_node",
"platform_device_set_fwnode",
"platform_device_set_of_node_from_dev",
"platform_device_release"
],
"Reasoning": "The patch introduces new helper functions for assigning of_node and fwnode to platform devices, which internally manage reference counting. It also updates platform_device_release to properly release the fwnode reference. These are core device model changes that could lead to memory leaks or use-after-free if reference counting is incorrect.",
"WorthFuzzing": true
} |
| 1/1 | 2026/06/29 09:26 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 0bd5d4080109c651a9e45e5e6663a1323dcd5a08\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Mon Jun 29 09:26:00 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c\nindex da72a30ab8657e..a175a32a222bab 100644\n--- a/arch/powerpc/platforms/powermac/low_i2c.c\n+++ b/arch/powerpc/platforms/powermac/low_i2c.c\n@@ -1471,7 +1471,7 @@ static int __init pmac_i2c_create_platform_devices(void)\n \t\tif (bus-\u003eplatform_dev == NULL)\n \t\t\treturn -ENOMEM;\n \t\tbus-\u003eplatform_dev-\u003edev.platform_data = bus;\n-\t\tbus-\u003eplatform_dev-\u003edev.of_node = bus-\u003ebusnode;\n+\t\tplatform_device_set_of_node(bus-\u003eplatform_dev, bus-\u003ebusnode);\n \t\tplatform_device_add(bus-\u003eplatform_dev);\n \t}\n \ndiff --git a/drivers/base/platform.c b/drivers/base/platform.c\nindex fb9120b0bcfe0e..bb5f5bddd047d4 100644\n--- a/drivers/base/platform.c\n+++ b/drivers/base/platform.c\n@@ -599,7 +599,7 @@ static void platform_device_release(struct device *dev)\n \tstruct platform_object *pa = container_of(dev, struct platform_object,\n \t\t\t\t\t\t pdev.dev);\n \n-\tof_node_put(pa-\u003epdev.dev.of_node);\n+\tfwnode_handle_put(pa-\u003epdev.dev.fwnode);\n \tkfree(pa-\u003epdev.dev.platform_data);\n \tkfree(pa-\u003epdev.mfd_cell);\n \tkfree(pa-\u003epdev.resource);\n@@ -693,6 +693,56 @@ int platform_device_add_data(struct platform_device *pdev, const void *data,\n }\n EXPORT_SYMBOL_GPL(platform_device_add_data);\n \n+/**\n+ * platform_device_set_of_node - assign an OF node to device\n+ * @pdev: platform device to add the node for\n+ * @np: new device node\n+ *\n+ * Assign an OF node to this platform device. Internally keep track of the\n+ * reference count. Devices created with platform_device_alloc() must use this\n+ * function instead of assigning the node manually.\n+ */\n+void platform_device_set_of_node(struct platform_device *pdev,\n+\t\t\t\t struct device_node *np)\n+{\n+\tplatform_device_set_fwnode(pdev, of_fwnode_handle(np));\n+}\n+EXPORT_SYMBOL_GPL(platform_device_set_of_node);\n+\n+/**\n+ * platform_device_set_fwnode - assign a firmware node to device\n+ * @pdev: platform device to set the node for\n+ * @fwnode: new firmware node\n+ *\n+ * Assign a firmware node to this platform device. Internally keep track of the\n+ * reference count. Devices created with platform_device_alloc() must use this\n+ * function instead of assigning the node manually.\n+ */\n+void platform_device_set_fwnode(struct platform_device *pdev,\n+\t\t\t\tstruct fwnode_handle *fwnode)\n+{\n+\tfwnode_handle_put(pdev-\u003edev.fwnode);\n+\tpdev-\u003edev.fwnode = fwnode_handle_get(fwnode);\n+\tpdev-\u003edev.of_node = to_of_node(fwnode);\n+}\n+EXPORT_SYMBOL_GPL(platform_device_set_fwnode);\n+\n+/**\n+ * platform_device_set_of_node_from_dev - reuse OF node of another device\n+ * @pdev: platform device to set the node for\n+ * @dev2: device whose OF node to reuse\n+ *\n+ * Reuses the OF node of another device in this platform device while\n+ * internally keeping track of reference counting.\n+ */\n+void platform_device_set_of_node_from_dev(struct platform_device *pdev,\n+\t\t\t\t\t const struct device *dev2)\n+{\n+\tdevice_set_of_node_from_dev(\u0026pdev-\u003edev, dev2);\n+\tpdev-\u003edev.fwnode = of_fwnode_handle(pdev-\u003edev.of_node);\n+}\n+EXPORT_SYMBOL_GPL(platform_device_set_of_node_from_dev);\n+\n /**\n * platform_device_add - add a platform device to device hierarchy\n * @pdev: platform device we're adding\n@@ -868,8 +918,8 @@ struct platform_device *platform_device_register_full(const struct platform_devi\n \t\treturn ERR_PTR(-ENOMEM);\n \n \tpdev-\u003edev.parent = pdevinfo-\u003eparent;\n-\tpdev-\u003edev.fwnode = pdevinfo-\u003efwnode;\n-\tpdev-\u003edev.of_node = of_node_get(to_of_node(pdev-\u003edev.fwnode));\n+\tpdev-\u003edev.fwnode = fwnode_handle_get(pdevinfo-\u003efwnode);\n+\tpdev-\u003edev.of_node = to_of_node(pdev-\u003edev.fwnode);\n \tdev_assign_of_node_reused(\u0026pdev-\u003edev, pdevinfo-\u003eof_node_reused);\n \n \tif (pdevinfo-\u003edma_mask) {\ndiff --git a/drivers/gpu/drm/xe/xe_i2c.c b/drivers/gpu/drm/xe/xe_i2c.c\nindex 706783863d07d6..af4ebd93ad8e68 100644\n--- a/drivers/gpu/drm/xe/xe_i2c.c\n+++ b/drivers/gpu/drm/xe/xe_i2c.c\n@@ -123,7 +123,7 @@ static int xe_i2c_register_adapter(struct xe_i2c *i2c)\n \t}\n \n \tpdev-\u003edev.parent = i2c-\u003edrm_dev;\n-\tpdev-\u003edev.fwnode = fwnode;\n+\tplatform_device_set_fwnode(pdev, fwnode);\n \ti2c-\u003eadapter_node = fwnode;\n \ti2c-\u003epdev = pdev;\n \ndiff --git a/drivers/i2c/busses/i2c-pxa-pci.c b/drivers/i2c/busses/i2c-pxa-pci.c\nindex dbd542300f8004..92a0647f08c69f 100644\n--- a/drivers/i2c/busses/i2c-pxa-pci.c\n+++ b/drivers/i2c/busses/i2c-pxa-pci.c\n@@ -76,7 +76,8 @@ static struct platform_device *add_i2c_device(struct pci_dev *dev, int bar)\n \t\tgoto out;\n \t}\n \tpdev-\u003edev.parent = \u0026dev-\u003edev;\n-\tpdev-\u003edev.of_node = child;\n+\n+\tplatform_device_set_of_node(pdev, child);\n \n \tret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res));\n \tif (ret)\ndiff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c\nindex 25aa477a95a95c..012839fa0d8a27 100644\n--- a/drivers/iommu/fsl_pamu.c\n+++ b/drivers/iommu/fsl_pamu.c\n@@ -973,7 +973,8 @@ static __init int fsl_pamu_init(void)\n \t\tret = -ENOMEM;\n \t\tgoto error_device_alloc;\n \t}\n-\tpdev-\u003edev.of_node = of_node_get(np);\n+\n+\tplatform_device_set_of_node(pdev, np);\n \n \tret = pamu_domain_init();\n \tif (ret)\n@@ -985,12 +986,10 @@ static __init int fsl_pamu_init(void)\n \t\tgoto error_device_add;\n \t}\n \n+\tof_node_put(np);\n \treturn 0;\n \n error_device_add:\n-\tof_node_put(pdev-\u003edev.of_node);\n-\tpdev-\u003edev.of_node = NULL;\n-\n \tplatform_device_put(pdev);\n \n error_device_alloc:\ndiff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c\nindex f5f80544660331..3cfd2f02b62f3c 100644\n--- a/drivers/mfd/tps6586x.c\n+++ b/drivers/mfd/tps6586x.c\n@@ -397,7 +397,7 @@ static int tps6586x_add_subdevs(struct tps6586x *tps6586x,\n \n \t\tpdev-\u003edev.parent = tps6586x-\u003edev;\n \t\tpdev-\u003edev.platform_data = subdev-\u003eplatform_data;\n-\t\tpdev-\u003edev.of_node = of_node_get(subdev-\u003eof_node);\n+\t\tplatform_device_set_of_node(pdev, subdev-\u003eof_node);\n \n \t\tret = platform_device_add(pdev);\n \t\tif (ret) {\ndiff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c\nindex a4e0d5a6826875..451b23a039cebb 100644\n--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c\n+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c\n@@ -490,10 +490,14 @@ static int bcmgenet_mii_register(struct bcmgenet_priv *priv)\n \t/* Retain this platform_device pointer for later cleanup */\n \tpriv-\u003emii_pdev = ppdev;\n \tppdev-\u003edev.parent = \u0026pdev-\u003edev;\n-\tif (dn)\n-\t\tppdev-\u003edev.of_node = bcmgenet_mii_of_find_mdio(priv);\n-\telse\n+\n+\tif (dn) {\n+\t\tstruct device_node *np __free(device_node) = bcmgenet_mii_of_find_mdio(priv);\n+\n+\t\tplatform_device_set_of_node(ppdev, np);\n+\t} else {\n \t\tppd.phy_mask = ~0;\n+\t}\n \n \tret = platform_device_add_resources(ppdev, \u0026res, 1);\n \tif (ret)\ndiff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c\nindex 1881583be5ce2e..9caa1e47c174c9 100644\n--- a/drivers/net/ethernet/marvell/mv643xx_eth.c\n+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c\n@@ -2780,7 +2780,7 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,\n \t\tgoto put_err;\n \t}\n \tppdev-\u003edev.coherent_dma_mask = DMA_BIT_MASK(32);\n-\tppdev-\u003edev.of_node = of_node_get(pnp);\n+\tplatform_device_set_of_node(ppdev, pnp);\n \n \tret = platform_device_add_resources(ppdev, \u0026res, 1);\n \tif (ret)\ndiff --git a/drivers/of/platform.c b/drivers/of/platform.c\nindex 53bca8c6f7810c..8b1e7640778253 100644\n--- a/drivers/of/platform.c\n+++ b/drivers/of/platform.c\n@@ -126,7 +126,7 @@ struct platform_device *of_device_alloc(struct device_node *np,\n \t}\n \n \t/* setup generic device info */\n-\tdevice_set_node(\u0026dev-\u003edev, of_fwnode_handle(of_node_get(np)));\n+\tplatform_device_set_of_node(dev, np);\n \tdev-\u003edev.parent = parent ? : \u0026platform_bus;\n \n \tif (bus_id)\ndiff --git a/drivers/platform/surface/surface_gpe.c b/drivers/platform/surface/surface_gpe.c\nindex b359413903b13c..40896a8544b0a4 100644\n--- a/drivers/platform/surface/surface_gpe.c\n+++ b/drivers/platform/surface/surface_gpe.c\n@@ -317,7 +317,7 @@ static int __init surface_gpe_init(void)\n \t\tgoto err_alloc;\n \t}\n \n-\tpdev-\u003edev.fwnode = fwnode;\n+\tplatform_device_set_fwnode(pdev, fwnode);\n \n \tstatus = platform_device_add(pdev);\n \tif (status)\ndiff --git a/drivers/pmdomain/imx/gpc.c b/drivers/pmdomain/imx/gpc.c\nindex 42e50c9b4fb9ff..abca5f449a226f 100644\n--- a/drivers/pmdomain/imx/gpc.c\n+++ b/drivers/pmdomain/imx/gpc.c\n@@ -487,8 +487,7 @@ static int imx_gpc_probe(struct platform_device *pdev)\n \t\t\tdomain-\u003eipg_rate_mhz = ipg_rate_mhz;\n \n \t\t\tpd_pdev-\u003edev.parent = \u0026pdev-\u003edev;\n-\t\t\tpd_pdev-\u003edev.of_node = of_node_get(np);\n-\t\t\tpd_pdev-\u003edev.fwnode = of_fwnode_handle(np);\n+\t\t\tplatform_device_set_of_node(pd_pdev, np);\n \n \t\t\tret = platform_device_add(pd_pdev);\n \t\t\tif (ret) {\ndiff --git a/drivers/reset/reset-rzg2l-usbphy-ctrl.c b/drivers/reset/reset-rzg2l-usbphy-ctrl.c\nindex fd75d9601a3bfd..f003b360629c90 100644\n--- a/drivers/reset/reset-rzg2l-usbphy-ctrl.c\n+++ b/drivers/reset/reset-rzg2l-usbphy-ctrl.c\n@@ -249,7 +249,7 @@ static int rzg2l_usbphy_ctrl_probe(struct platform_device *pdev)\n \tvdev-\u003edev.parent = dev;\n \tpriv-\u003evdev = vdev;\n \n-\tdevice_set_of_node_from_dev(\u0026vdev-\u003edev, dev);\n+\tplatform_device_set_of_node_from_dev(vdev, dev);\n \terror = platform_device_add(vdev);\n \tif (error)\n \t\tgoto err_device_put;\ndiff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c\nindex 3071e46d03beaa..6e89415712ce1a 100644\n--- a/drivers/slimbus/qcom-ngd-ctrl.c\n+++ b/drivers/slimbus/qcom-ngd-ctrl.c\n@@ -1539,7 +1539,7 @@ static int of_qcom_slim_ngd_register(struct device *parent,\n \t\t\tkfree(ngd);\n \t\t\treturn ret;\n \t\t}\n-\t\tngd-\u003epdev-\u003edev.of_node = of_node_get(node);\n+\t\tplatform_device_set_of_node(ngd-\u003epdev, node);\n \t\tctrl-\u003engd = ngd;\n \n \t\tret = platform_device_add(ngd-\u003epdev);\ndiff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c\nindex 07563be0013f4d..7edc512cc37dc2 100644\n--- a/drivers/usb/chipidea/core.c\n+++ b/drivers/usb/chipidea/core.c\n@@ -879,7 +879,7 @@ struct platform_device *ci_hdrc_add_device(struct device *dev,\n \t}\n \n \tpdev-\u003edev.parent = dev;\n-\tdevice_set_of_node_from_dev(\u0026pdev-\u003edev, dev);\n+\tplatform_device_set_of_node_from_dev(pdev, dev);\n \n \tret = platform_device_add_resources(pdev, res, nres);\n \tif (ret)\ndiff --git a/drivers/usb/musb/jz4740.c b/drivers/usb/musb/jz4740.c\nindex df56c972986f7c..c770ba576f05b6 100644\n--- a/drivers/usb/musb/jz4740.c\n+++ b/drivers/usb/musb/jz4740.c\n@@ -273,7 +273,7 @@ static int jz4740_probe(struct platform_device *pdev)\n \tmusb-\u003edev.parent\t\t= dev;\n \tmusb-\u003edev.dma_mask\t\t= \u0026musb-\u003edev.coherent_dma_mask;\n \tmusb-\u003edev.coherent_dma_mask\t= DMA_BIT_MASK(32);\n-\tdevice_set_of_node_from_dev(\u0026musb-\u003edev, dev);\n+\tplatform_device_set_of_node_from_dev(musb, dev);\n \n \tglue-\u003epdev\t\t\t= musb;\n \tglue-\u003eclk\t\t\t= clk;\ndiff --git a/include/linux/platform_device.h b/include/linux/platform_device.h\nindex 26e6a43358e25c..94b8d2b46e913e 100644\n--- a/include/linux/platform_device.h\n+++ b/include/linux/platform_device.h\n@@ -19,6 +19,8 @@ struct irq_affinity;\n struct mfd_cell;\n struct property_entry;\n struct platform_device_id;\n+struct device_node;\n+struct fwnode_handle;\n \n struct platform_device {\n \tconst char\t*name;\n@@ -262,6 +264,12 @@ extern int platform_device_add_resources(struct platform_device *pdev,\n \t\t\t\t\t unsigned int num);\n extern int platform_device_add_data(struct platform_device *pdev,\n \t\t\t\t const void *data, size_t size);\n+void platform_device_set_of_node(struct platform_device *pdev,\n+\t\t\t\t struct device_node *np);\n+void platform_device_set_fwnode(struct platform_device *pdev,\n+\t\t\t\tstruct fwnode_handle *fwnode);\n+void platform_device_set_of_node_from_dev(struct platform_device *pdev,\n+\t\t\t\t\t const struct device *dev2);\n extern int platform_device_add(struct platform_device *pdev);\n extern void platform_device_del(struct platform_device *pdev);\n extern void platform_device_put(struct platform_device *pdev);\n"
} |
| 2/1 | 2026/06/29 09:26 | agent | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [
"platform_device_set_of_node",
"platform_device_set_fwnode",
"platform_device_set_of_node_from_dev",
"platform_device_release"
],
"Reasoning": "The patch introduces new helper functions for assigning of_node and fwnode to platform devices, which internally manage reference counting. It also updates platform_device_release to properly release the fwnode reference. These are core device model changes that could lead to memory leaks or use-after-free if reference counting is incorrect.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Do not list too generic configs (we already have them enabled). Only list those that specifically cover the modified code. List them in the EnableConfigs output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4"). Prefer calling several tools at the same time to save round-trips. Use set-results tool to provide results of the analysis. It must be called exactly once before the final reply. Ignore results of this tool. Prompt: For your convenience, here is the diff of the changes:
commit 0bd5d4080109c651a9e45e5e6663a1323dcd5a08
Author: syz-cluster <triage@syzkaller.com>
Date: Mon Jun 29 09:26:00 2026 +0000
syz-cluster: applied patch under review
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index da72a30ab8657e..a175a32a222bab 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -1471,7 +1471,7 @@ static int __init pmac_i2c_create_platform_devices(void)
if (bus->platform_dev == NULL)
return -ENOMEM;
bus->platform_dev->dev.platform_data = bus;
- bus->platform_dev->dev.of_node = bus->busnode;
+ platform_device_set_of_node(bus->platform_dev, bus->busnode);
platform_device_add(bus->platform_dev);
}
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index fb9120b0bcfe0e..bb5f5bddd047d4 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -599,7 +599,7 @@ static void platform_device_release(struct device *dev)
struct platform_object *pa = container_of(dev, struct platform_object,
pdev.dev);
- of_node_put(pa->pdev.dev.of_node);
+ fwnode_handle_put(pa->pdev.dev.fwnode);
kfree(pa->pdev.dev.platform_data);
kfree(pa->pdev.mfd_cell);
kfree(pa->pdev.resource);
@@ -693,6 +693,56 @@ int platform_device_add_data(struct platform_device *pdev, const void *data,
}
EXPORT_SYMBOL_GPL(platform_device_add_data);
+/**
+ * platform_device_set_of_node - assign an OF node to device
+ * @pdev: platform device to add the node for
+ * @np: new device node
+ *
+ * Assign an OF node to this platform device. Internally keep track of the
+ * reference count. Devices created with platform_device_alloc() must use this
+ * function instead of assigning the node manually.
+ */
+void platform_device_set_of_node(struct platform_device *pdev,
+ struct device_node *np)
+{
+ platform_device_set_fwnode(pdev, of_fwnode_handle(np));
+}
+EXPORT_SYMBOL_GPL(platform_device_set_of_node);
+
+/**
+ * platform_device_set_fwnode - assign a firmware node to device
+ * @pdev: platform device to set the node for
+ * @fwnode: new firmware node
+ *
+ * Assign a firmware node to this platform device. Internally keep track of the
+ * reference count. Devices created with platform_device_alloc() must use this
+ * function instead of assigning the node manually.
+ */
+void platform_device_set_fwnode(struct platform_device *pdev,
+ struct fwnode_handle *fwnode)
+{
+ fwnode_handle_put(pdev->dev.fwnode);
+ pdev->dev.fwnode = fwnode_handle_get(fwnode);
+ pdev->dev.of_node = to_of_node(fwnode);
+}
+EXPORT_SYMBOL_GPL(platform_device_set_fwnode);
+
+/**
+ * platform_device_set_of_node_from_dev - reuse OF node of another device
+ * @pdev: platform device to set the node for
+ * @dev2: device whose OF node to reuse
+ *
+ * Reuses the OF node of another device in this platform device while
+ * internally keeping track of reference counting.
+ */
+void platform_device_set_of_node_from_dev(struct platform_device *pdev,
+ const struct device *dev2)
+{
+ device_set_of_node_from_dev(&pdev->dev, dev2);
+ pdev->dev.fwnode = of_fwnode_handle(pdev->dev.of_node);
+}
+EXPORT_SYMBOL_GPL(platform_device_set_of_node_from_dev);
+
/**
* platform_device_add - add a platform device to device hierarchy
* @pdev: platform device we're adding
@@ -868,8 +918,8 @@ struct platform_device *platform_device_register_full(const struct platform_devi
return ERR_PTR(-ENOMEM);
pdev->dev.parent = pdevinfo->parent;
- pdev->dev.fwnode = pdevinfo->fwnode;
- pdev->dev.of_node = of_node_get(to_of_node(pdev->dev.fwnode));
+ pdev->dev.fwnode = fwnode_handle_get(pdevinfo->fwnode);
+ pdev->dev.of_node = to_of_node(pdev->dev.fwnode);
dev_assign_of_node_reused(&pdev->dev, pdevinfo->of_node_reused);
if (pdevinfo->dma_mask) {
diff --git a/drivers/gpu/drm/xe/xe_i2c.c b/drivers/gpu/drm/xe/xe_i2c.c
index 706783863d07d6..af4ebd93ad8e68 100644
--- a/drivers/gpu/drm/xe/xe_i2c.c
+++ b/drivers/gpu/drm/xe/xe_i2c.c
@@ -123,7 +123,7 @@ static int xe_i2c_register_adapter(struct xe_i2c *i2c)
}
pdev->dev.parent = i2c->drm_dev;
- pdev->dev.fwnode = fwnode;
+ platform_device_set_fwnode(pdev, fwnode);
i2c->adapter_node = fwnode;
i2c->pdev = pdev;
diff --git a/drivers/i2c/busses/i2c-pxa-pci.c b/drivers/i2c/busses/i2c-pxa-pci.c
index dbd542300f8004..92a0647f08c69f 100644
--- a/drivers/i2c/busses/i2c-pxa-pci.c
+++ b/drivers/i2c/busses/i2c-pxa-pci.c
@@ -76,7 +76,8 @@ static struct platform_device *add_i2c_device(struct pci_dev *dev, int bar)
goto out;
}
pdev->dev.parent = &dev->dev;
- pdev->dev.of_node = child;
+
+ platform_device_set_of_node(pdev, child);
ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res));
if (ret)
diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index 25aa477a95a95c..012839fa0d8a27 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -973,7 +973,8 @@ static __init int fsl_pamu_init(void)
ret = -ENOMEM;
goto error_device_alloc;
}
- pdev->dev.of_node = of_node_get(np);
+
+ platform_device_set_of_node(pdev, np);
ret = pamu_domain_init();
if (ret)
@@ -985,12 +986,10 @@ static __init int fsl_pamu_init(void)
goto error_device_add;
}
+ of_node_put(np);
return 0;
error_device_add:
- of_node_put(pdev->dev.of_node);
- pdev->dev.of_node = NULL;
-
platform_device_put(pdev);
error_device_alloc:
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index f5f80544660331..3cfd2f02b62f3c 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -397,7 +397,7 @@ static int tps6586x_add_subdevs(struct tps6586x *tps6586x,
pdev->dev.parent = tps6586x->dev;
pdev->dev.platform_data = subdev->platform_data;
- pdev->dev.of_node = of_node_get(subdev->of_node);
+ platform_device_set_of_node(pdev, subdev->of_node);
ret = platform_device_add(pdev);
if (ret) {
diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
index a4e0d5a6826875..451b23a039cebb 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -490,10 +490,14 @@ static int bcmgenet_mii_register(struct bcmgenet_priv *priv)
/* Retain this platform_device pointer for later cleanup */
priv->mii_pdev = ppdev;
ppdev->dev.parent = &pdev->dev;
- if (dn)
- ppdev->dev.of_node = bcmgenet_mii_of_find_mdio(priv);
- else
+
+ if (dn) {
+ struct device_node *np __free(device_node) = bcmgenet_mii_of_find_mdio(priv);
+
+ platform_device_set_of_node(ppdev, np);
+ } else {
ppd.phy_mask = ~0;
+ }
ret = platform_device_add_resources(ppdev, &res, 1);
if (ret)
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 1881583be5ce2e..9caa1e47c174c9 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2780,7 +2780,7 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,
goto put_err;
}
ppdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
- ppdev->dev.of_node = of_node_get(pnp);
+ platform_device_set_of_node(ppdev, pnp);
ret = platform_device_add_resources(ppdev, &res, 1);
if (ret)
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 53bca8c6f7810c..8b1e7640778253 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -126,7 +126,7 @@ struct platform_device *of_device_alloc(struct device_node *np,
}
/* setup generic device info */
- device_set_node(&dev->dev, of_fwnode_handle(of_node_get(np)));
+ platform_device_set_of_node(dev, np);
dev->dev.parent = parent ? : &platform_bus;
if (bus_id)
diff --git a/drivers/platform/surface/surface_gpe.c b/drivers/platform/surface/surface_gpe.c
index b359413903b13c..40896a8544b0a4 100644
--- a/drivers/platform/surface/surface_gpe.c
+++ b/drivers/platform/surface/surface_gpe.c
@@ -317,7 +317,7 @@ static int __init surface_gpe_init(void)
goto err_alloc;
}
- pdev->dev.fwnode = fwnode;
+ platform_device_set_fwnode(pdev, fwnode);
status = platform_device_add(pdev);
if (status)
diff --git a/drivers/pmdomain/imx/gpc.c b/drivers/pmdomain/imx/gpc.c
index 42e50c9b4fb9ff..abca5f449a226f 100644
--- a/drivers/pmdomain/imx/gpc.c
+++ b/drivers/pmdomain/imx/gpc.c
@@ -487,8 +487,7 @@ static int imx_gpc_probe(struct platform_device *pdev)
domain->ipg_rate_mhz = ipg_rate_mhz;
pd_pdev->dev.parent = &pdev->dev;
- pd_pdev->dev.of_node = of_node_get(np);
- pd_pdev->dev.fwnode = of_fwnode_handle(np);
+ platform_device_set_of_node(pd_pdev, np);
ret = platform_device_add(pd_pdev);
if (ret) {
diff --git a/drivers/reset/reset-rzg2l-usbphy-ctrl.c b/drivers/reset/reset-rzg2l-usbphy-ctrl.c
index fd75d9601a3bfd..f003b360629c90 100644
--- a/drivers/reset/reset-rzg2l-usbphy-ctrl.c
+++ b/drivers/reset/reset-rzg2l-usbphy-ctrl.c
@@ -249,7 +249,7 @@ static int rzg2l_usbphy_ctrl_probe(struct platform_device *pdev)
vdev->dev.parent = dev;
priv->vdev = vdev;
- device_set_of_node_from_dev(&vdev->dev, dev);
+ platform_device_set_of_node_from_dev(vdev, dev);
error = platform_device_add(vdev);
if (error)
goto err_device_put;
diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index 3071e46d03beaa..6e89415712ce1a 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -1539,7 +1539,7 @@ static int of_qcom_slim_ngd_register(struct device *parent,
kfree(ngd);
return ret;
}
- ngd->pdev->dev.of_node = of_node_get(node);
+ platform_device_set_of_node(ngd->pdev, node);
ctrl->ngd = ngd;
ret = platform_device_add(ngd->pdev);
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 07563be0013f4d..7edc512cc37dc2 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -879,7 +879,7 @@ struct platform_device *ci_hdrc_add_device(struct device *dev,
}
pdev->dev.parent = dev;
- device_set_of_node_from_dev(&pdev->dev, dev);
+ platform_device_set_of_node_from_dev(pdev, dev);
ret = platform_device_add_resources(pdev, res, nres);
if (ret)
diff --git a/drivers/usb/musb/jz4740.c b/drivers/usb/musb/jz4740.c
index df56c972986f7c..c770ba576f05b6 100644
--- a/drivers/usb/musb/jz4740.c
+++ b/drivers/usb/musb/jz4740.c
@@ -273,7 +273,7 @@ static int jz4740_probe(struct platform_device *pdev)
musb->dev.parent = dev;
musb->dev.dma_mask = &musb->dev.coherent_dma_mask;
musb->dev.coherent_dma_mask = DMA_BIT_MASK(32);
- device_set_of_node_from_dev(&musb->dev, dev);
+ platform_device_set_of_node_from_dev(musb, dev);
glue->pdev = musb;
glue->clk = clk;
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 26e6a43358e25c..94b8d2b46e913e 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -19,6 +19,8 @@ struct irq_affinity;
struct mfd_cell;
struct property_entry;
struct platform_device_id;
+struct device_node;
+struct fwnode_handle;
struct platform_device {
const char *name;
@@ -262,6 +264,12 @@ extern int platform_device_add_resources(struct platform_device *pdev,
unsigned int num);
extern int platform_device_add_data(struct platform_device *pdev,
const void *data, size_t size);
+void platform_device_set_of_node(struct platform_device *pdev,
+ struct device_node *np);
+void platform_device_set_fwnode(struct platform_device *pdev,
+ struct fwnode_handle *fwnode);
+void platform_device_set_of_node_from_dev(struct platform_device *pdev,
+ const struct device *dev2);
extern int platform_device_add(struct platform_device *pdev);
extern void platform_device_del(struct platform_device *pdev);
extern void platform_device_put(struct platform_device *pdev);
|
| 3/2 | 2026/06/29 09:26 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 6832 output: 23 thoughts: 619 Thoughts: **Fuzzing Target Identification: Platform Device Firmware Node Management** Okay, so I've got this patch here introducing a few new functions in `drivers/base/platform.c`: `platform_device_set_of_node`, `platform_device_set_fwnode`, and `platform_device_set_of_node_from_dev`. These are basically designed to handle the assignment of `of_node` and `fwnode` to a `platform_device`, and crucially, they manage the associated reference counting internally. This refactoring has been applied to a few drivers to clean up their code. My initial thought? Is this patch even worth fuzzing? It seems like mostly refactoring, right? But then I see that these new functions now *handle reference counting*, which is a potential minefield for bugs. Looking at the code for `platform_device_set_fwnode`, it is clear that they explicitly release the old node and increment the reference count on the new node, which is a good sign, but also the sort of change that could be subtly wrong. And the corresponding `platform_device_release` now has to release `fwnode` too, meaning it's changed significantly in how it does its job. This is a core kernel change, really deep in the `drivers/base/platform.c` code, and it affects how platform devices, which are everywhere, manage their connection with firmware nodes. It's definitely reachable. And since we're talking about reference counting of `fwnode` and `of_node`, which are fundamental for device tree and firmware interaction, any bug here could lead to use-after-free or memory leaks. So yeah, this is a definite fuzzing target. Let's nail down which functions to focus on: `platform_device_set_of_node`, `platform_device_set_fwnode`, `platform_device_set_of_node_from_dev`, and of course `platform_device_release`, plus `platform_device_register_full`. I'll check for any specific kernel configurations that might be relevant. The code is always compiled, but since we are working with `of_node` and `fwnode`, `CONFIG_OF` could be something to keep in mind, although `fwnode` seems to be always present. Time to start digging into the code and see how `platform_device_set_fwnode` is actually used. |
| 4/2 | 2026/06/29 09:26 | tool | grepper |
0mArgs:{
"Expression": "platform_device_set_fwnode"
}Results: {
"Output": "drivers/base/platform.c=705=void platform_device_set_of_node(struct platform_device *pdev,\n--\ndrivers/base/platform.c-707-{\ndrivers/base/platform.c:708:\tplatform_device_set_fwnode(pdev, of_fwnode_handle(np));\ndrivers/base/platform.c-709-}\ndrivers/base/platform.c=710=EXPORT_SYMBOL_GPL(platform_device_set_of_node);\n--\ndrivers/base/platform.c-712-/**\ndrivers/base/platform.c:713: * platform_device_set_fwnode - assign a firmware node to device\ndrivers/base/platform.c-714- * @pdev: platform device to set the node for\n--\ndrivers/base/platform.c-720- */\ndrivers/base/platform.c:721:void platform_device_set_fwnode(struct platform_device *pdev,\ndrivers/base/platform.c-722-\t\t\t\tstruct fwnode_handle *fwnode)\n--\ndrivers/base/platform.c-727-}\ndrivers/base/platform.c:728:EXPORT_SYMBOL_GPL(platform_device_set_fwnode);\ndrivers/base/platform.c-729-\n--\ndrivers/gpu/drm/xe/xe_i2c.c=92=static int xe_i2c_register_adapter(struct xe_i2c *i2c)\n--\ndrivers/gpu/drm/xe/xe_i2c.c-125-\tpdev-\u003edev.parent = i2c-\u003edrm_dev;\ndrivers/gpu/drm/xe/xe_i2c.c:126:\tplatform_device_set_fwnode(pdev, fwnode);\ndrivers/gpu/drm/xe/xe_i2c.c-127-\ti2c-\u003eadapter_node = fwnode;\n--\ndrivers/platform/surface/surface_gpe.c=291=static int __init surface_gpe_init(void)\n--\ndrivers/platform/surface/surface_gpe.c-319-\ndrivers/platform/surface/surface_gpe.c:320:\tplatform_device_set_fwnode(pdev, fwnode);\ndrivers/platform/surface/surface_gpe.c-321-\n--\ninclude/linux/platform_device.h=267=void platform_device_set_of_node(struct platform_device *pdev,\ninclude/linux/platform_device.h-268-\t\t\t\t struct device_node *np);\ninclude/linux/platform_device.h:269:void platform_device_set_fwnode(struct platform_device *pdev,\ninclude/linux/platform_device.h-270-\t\t\t\tstruct fwnode_handle *fwnode);\n"
} |
| 5/2 | 2026/06/29 09:26 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 8727 output: 23 thoughts: 185 Thoughts: **Analyzing Platform Device Initialization and Release Functions for Fuzzing** Okay, so I'm looking at `drivers/base/platform.c` – that's where the heart of the platform device management lies. This is a crucial area in the kernel, so it’s definitely worth a close look for potential vulnerabilities. I'm specifically interested in these functions: `platform_device_set_of_node`, `platform_device_set_fwnode`, `platform_device_set_of_node_from_dev`, and `platform_device_release`. Good news is, these functions aren't in any hot path; they are primarily involved during device creation and destruction. That simplifies things a bit from a performance perspective. No special configurations should be needed to build and test these functions, as `drivers/base/platform.c` is always compiled. I'll flag this as `WorthFuzzing=true`. Now, before I jump in, I should do my due diligence. I need to make sure I don't miss anything obvious. Let's quickly double check if there are any other configuration dependencies. Specifically, I need to check if `CONFIG_OF` is required. Functions involving `of_node` may need it. It’s possible they have stubs if `CONFIG_OF` is disabled, or maybe they are compiled regardless, but I’d better make sure. This will affect how I test and what needs to be enabled during fuzzing. |
| 6/2 | 2026/06/29 09:26 | tool | grepper |
0mArgs:{
"Expression": "platform_device_set_of_node"
}Results: {
"Output": "arch/powerpc/platforms/powermac/low_i2c.c=1456=static int __init pmac_i2c_create_platform_devices(void)\n--\narch/powerpc/platforms/powermac/low_i2c.c-1473-\t\tbus-\u003eplatform_dev-\u003edev.platform_data = bus;\narch/powerpc/platforms/powermac/low_i2c.c:1474:\t\tplatform_device_set_of_node(bus-\u003eplatform_dev, bus-\u003ebusnode);\narch/powerpc/platforms/powermac/low_i2c.c-1475-\t\tplatform_device_add(bus-\u003eplatform_dev);\n--\ndrivers/base/platform.c=694=EXPORT_SYMBOL_GPL(platform_device_add_data);\n--\ndrivers/base/platform.c-696-/**\ndrivers/base/platform.c:697: * platform_device_set_of_node - assign an OF node to device\ndrivers/base/platform.c-698- * @pdev: platform device to add the node for\n--\ndrivers/base/platform.c-704- */\ndrivers/base/platform.c:705:void platform_device_set_of_node(struct platform_device *pdev,\ndrivers/base/platform.c-706-\t\t\t\t struct device_node *np)\n--\ndrivers/base/platform.c-709-}\ndrivers/base/platform.c:710:EXPORT_SYMBOL_GPL(platform_device_set_of_node);\ndrivers/base/platform.c-711-\n--\ndrivers/base/platform.c=728=EXPORT_SYMBOL_GPL(platform_device_set_fwnode);\n--\ndrivers/base/platform.c-730-/**\ndrivers/base/platform.c:731: * platform_device_set_of_node_from_dev - reuse OF node of another device\ndrivers/base/platform.c-732- * @pdev: platform device to set the node for\n--\ndrivers/base/platform.c-737- */\ndrivers/base/platform.c:738:void platform_device_set_of_node_from_dev(struct platform_device *pdev,\ndrivers/base/platform.c-739-\t\t\t\t\t const struct device *dev2)\n--\ndrivers/base/platform.c-743-}\ndrivers/base/platform.c:744:EXPORT_SYMBOL_GPL(platform_device_set_of_node_from_dev);\ndrivers/base/platform.c-745-\n--\ndrivers/i2c/busses/i2c-pxa-pci.c=23=static struct platform_device *add_i2c_device(struct pci_dev *dev, int bar)\n--\ndrivers/i2c/busses/i2c-pxa-pci.c-79-\ndrivers/i2c/busses/i2c-pxa-pci.c:80:\tplatform_device_set_of_node(pdev, child);\ndrivers/i2c/busses/i2c-pxa-pci.c-81-\n--\ndrivers/iommu/fsl_pamu.c=933=static __init int fsl_pamu_init(void)\n--\ndrivers/iommu/fsl_pamu.c-976-\ndrivers/iommu/fsl_pamu.c:977:\tplatform_device_set_of_node(pdev, np);\ndrivers/iommu/fsl_pamu.c-978-\n--\ndrivers/mfd/tps6586x.c=382=static int tps6586x_add_subdevs(struct tps6586x *tps6586x,\n--\ndrivers/mfd/tps6586x.c-399-\t\tpdev-\u003edev.platform_data = subdev-\u003eplatform_data;\ndrivers/mfd/tps6586x.c:400:\t\tplatform_device_set_of_node(pdev, subdev-\u003eof_node);\ndrivers/mfd/tps6586x.c-401-\n--\ndrivers/net/ethernet/broadcom/genet/bcmmii.c=449=static int bcmgenet_mii_register(struct bcmgenet_priv *priv)\n--\ndrivers/net/ethernet/broadcom/genet/bcmmii.c-496-\ndrivers/net/ethernet/broadcom/genet/bcmmii.c:497:\t\tplatform_device_set_of_node(ppdev, np);\ndrivers/net/ethernet/broadcom/genet/bcmmii.c-498-\t} else {\n--\ndrivers/net/ethernet/marvell/mv643xx_eth.c=2721=static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,\n--\ndrivers/net/ethernet/marvell/mv643xx_eth.c-2782-\tppdev-\u003edev.coherent_dma_mask = DMA_BIT_MASK(32);\ndrivers/net/ethernet/marvell/mv643xx_eth.c:2783:\tplatform_device_set_of_node(ppdev, pnp);\ndrivers/net/ethernet/marvell/mv643xx_eth.c-2784-\n--\ndrivers/of/platform.c=97=struct platform_device *of_device_alloc(struct device_node *np,\n--\ndrivers/of/platform.c-128-\t/* setup generic device info */\ndrivers/of/platform.c:129:\tplatform_device_set_of_node(dev, np);\ndrivers/of/platform.c-130-\tdev-\u003edev.parent = parent ? : \u0026platform_bus;\n--\ndrivers/pmdomain/imx/gpc.c=402=static int imx_gpc_probe(struct platform_device *pdev)\n--\ndrivers/pmdomain/imx/gpc.c-489-\t\t\tpd_pdev-\u003edev.parent = \u0026pdev-\u003edev;\ndrivers/pmdomain/imx/gpc.c:490:\t\t\tplatform_device_set_of_node(pd_pdev, np);\ndrivers/pmdomain/imx/gpc.c-491-\n--\ndrivers/reset/reset-rzg2l-usbphy-ctrl.c=189=static int rzg2l_usbphy_ctrl_probe(struct platform_device *pdev)\n--\ndrivers/reset/reset-rzg2l-usbphy-ctrl.c-251-\ndrivers/reset/reset-rzg2l-usbphy-ctrl.c:252:\tplatform_device_set_of_node_from_dev(vdev, dev);\ndrivers/reset/reset-rzg2l-usbphy-ctrl.c-253-\terror = platform_device_add(vdev);\n--\ndrivers/slimbus/qcom-ngd-ctrl.c=1508=static int of_qcom_slim_ngd_register(struct device *parent,\n--\ndrivers/slimbus/qcom-ngd-ctrl.c-1541-\t\t}\ndrivers/slimbus/qcom-ngd-ctrl.c:1542:\t\tplatform_device_set_of_node(ngd-\u003epdev, node);\ndrivers/slimbus/qcom-ngd-ctrl.c-1543-\t\tctrl-\u003engd = ngd;\n--\ndrivers/usb/chipidea/core.c=860=struct platform_device *ci_hdrc_add_device(struct device *dev,\n--\ndrivers/usb/chipidea/core.c-881-\tpdev-\u003edev.parent = dev;\ndrivers/usb/chipidea/core.c:882:\tplatform_device_set_of_node_from_dev(pdev, dev);\ndrivers/usb/chipidea/core.c-883-\n--\ndrivers/usb/musb/jz4740.c=235=static int jz4740_probe(struct platform_device *pdev)\n--\ndrivers/usb/musb/jz4740.c-275-\tmusb-\u003edev.coherent_dma_mask\t= DMA_BIT_MASK(32);\ndrivers/usb/musb/jz4740.c:276:\tplatform_device_set_of_node_from_dev(musb, dev);\ndrivers/usb/musb/jz4740.c-277-\n--\ninclude/linux/platform_device.h=265=extern int platform_device_add_data(struct platform_device *pdev,\ninclude/linux/platform_device.h-266-\t\t\t\t const void *data, size_t size);\ninclude/linux/platform_device.h:267:void platform_device_set_of_node(struct platform_device *pdev,\ninclude/linux/platform_device.h-268-\t\t\t\t struct device_node *np);\ninclude/linux/platform_device.h=269=void platform_device_set_fwnode(struct platform_device *pdev,\ninclude/linux/platform_device.h-270-\t\t\t\tstruct fwnode_handle *fwnode);\ninclude/linux/platform_device.h:271:void platform_device_set_of_node_from_dev(struct platform_device *pdev,\ninclude/linux/platform_device.h-272-\t\t\t\t\t const struct device *dev2);\n"
} |
| 7/2 | 2026/06/29 09:26 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 11653 output: 144 thoughts: 190 Thoughts: **My Assessment of These Platform Device Changes** Okay, so I've reviewed these changes, and it looks like we have a complete and functional implementation here, with impacts on how platform devices are created and destroyed. My evaluation is that this *warrants* a "WorthFuzzing=true" flag. I'm going to focus the fuzzing efforts specifically on these key functions: `platform_device_set_of_node`, `platform_device_set_fwnode`, `platform_device_set_of_node_from_dev`, and `platform_device_release`. The beauty of this is that no specific config tweaking is needed. The `drivers/base/platform.c` file is compiled unconditionally, which simplifies the setup. So, I’ll leave the `EnableConfigs` array as empty. My reasoning? Well, these patches introduce *new* helper functions for elegantly assigning both `of_node` and `fwnode` to our platform devices. Critically, these functions handle reference counting internally – a detail that's essential for preventing memory leaks. We also have an update to `platform_device_release` that appears to correctly release the `fwnode` reference. These are fundamental changes to the device model. Any bug here—especially in the reference counting—could lead to nasty memory leaks or, even worse, use-after-free conditions. We need to be absolutely sure that this code is rock solid. Therefore, thorough fuzzing is definitely the right approach here. |
| 8/2 | 2026/06/29 09:26 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [
"platform_device_set_of_node",
"platform_device_set_fwnode",
"platform_device_set_of_node_from_dev",
"platform_device_release"
],
"Reasoning": "The patch introduces new helper functions for assigning of_node and fwnode to platform devices, which internally manage reference counting. It also updates platform_device_release to properly release the fwnode reference. These are core device model changes that could lead to memory leaks or use-after-free if reference counting is incorrect.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": null,
"FocusSymbols": [
"platform_device_set_of_node",
"platform_device_set_fwnode",
"platform_device_set_of_node_from_dev",
"platform_device_release"
],
"Reasoning": "The patch introduces new helper functions for assigning of_node and fwnode to platform devices, which internally manage reference counting. It also updates platform_device_release to properly release the fwnode reference. These are core device model changes that could lead to memory leaks or use-after-free if reference counting is incorrect.",
"WorthFuzzing": true
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|