pinctrl: imx: Fix NULL dereference in imx_pinctrl_probe()
authorJesse Taube <mr.bossman075@gmail.com>
Fri, 17 Jan 2025 03:00:48 +0000 (22:00 -0500)
committerFabio Estevam <festevam@gmail.com>
Mon, 20 Jan 2025 11:41:23 +0000 (08:41 -0300)
When converting to ofnode `ofnode_read_u32` was accedentally used to
replace `fdtdec_get_int` instead of `ofnode_read_u32_default`.
Use `ofnode_read_u32_default` to fix this.

Fixes: 59382d2 ("pinctrl: imx: Convert to use livetree API for fdt access")
Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
drivers/pinctrl/nxp/pinctrl-imx.c

index b1960c5..54cec37 100644 (file)
@@ -219,7 +219,7 @@ int imx_pinctrl_probe(struct udevice *dev,
        if (info->flags & IMX8_USE_SCU)
                return 0;
 
-       addr = ofnode_get_addr_size_index(dev_ofnode(dev), 0, &size);
+       addr = ofnode_get_addr_size_index(node, 0, &size);
        if (addr == FDT_ADDR_T_NONE)
                return -EINVAL;
 
@@ -228,7 +228,7 @@ int imx_pinctrl_probe(struct udevice *dev,
                return -ENOMEM;
        priv->info = info;
 
-       info->mux_mask = ofnode_read_u32(node, "fsl,mux_mask", 0);
+       info->mux_mask = ofnode_read_u32_default(node, "fsl,mux_mask", 0);
        /*
         * Refer to linux documentation for details:
         * Documentation/devicetree/bindings/pinctrl/fsl,imx7d-pinctrl.txt