From b65ea8534fc9d59e9742e76820d03f6783db3cf5 Mon Sep 17 00:00:00 2001 From: Andrew Goodbody Date: Wed, 23 Jul 2025 17:32:45 +0100 Subject: clk: imx: Free pll on error path For an unknown pll type the error path neglects to free the memory just allocated. Add the free. This issue was found by Smatch. Signed-off-by: Andrew Goodbody --- drivers/clk/imx/clk-pll14xx.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/clk/imx/clk-pll14xx.c b/drivers/clk/imx/clk-pll14xx.c index 7ec78dc3a80..f9fcec18f9f 100644 --- a/drivers/clk/imx/clk-pll14xx.c +++ b/drivers/clk/imx/clk-pll14xx.c @@ -409,6 +409,7 @@ struct clk *imx_clk_pll14xx(const char *name, const char *parent_name, default: pr_err("%s: Unknown pll type for pll clk %s\n", __func__, name); + kfree(pll); return ERR_PTR(-EINVAL); }; -- cgit v1.3.1 From 66324e0cecaa99bf99dd39b5bca7f292b4225e0d Mon Sep 17 00:00:00 2001 From: Andrew Goodbody Date: Thu, 24 Jul 2025 15:46:49 +0100 Subject: cpu: imx8_cpu: Provide default temperatures Add setting default temperatures to the weak version of get_cpu_temp_grade so these values will not be used uninitialised. This issue was found by Smatch. Signed-off-by: Andrew Goodbody --- drivers/cpu/imx8_cpu.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers') diff --git a/drivers/cpu/imx8_cpu.c b/drivers/cpu/imx8_cpu.c index 4836bddd93b..950630453f9 100644 --- a/drivers/cpu/imx8_cpu.c +++ b/drivers/cpu/imx8_cpu.c @@ -201,6 +201,10 @@ static int cpu_imx_get_temp(struct cpu_imx_plat *plat) __weak u32 get_cpu_temp_grade(int *minc, int *maxc) { + if (minc && maxc) { + *minc = 0; + *maxc = 95; + } return 0; } -- cgit v1.3.1 From 5275b5612b55a0fac7df32b5eaf4c997c39419c4 Mon Sep 17 00:00:00 2001 From: Andrew Goodbody Date: Mon, 28 Jul 2025 17:42:21 +0100 Subject: imx: scu_api: Remove unnecessary NULL check In sc_seco_secvio_dgo_config there is a check for data being NULL but this occurs after data has already been dereferenced. All callers of the function provide a valid pointer for data so no need for the NULL check. This issue was found by Smatch. Signed-off-by: Andrew Goodbody --- drivers/misc/imx8/scu_api.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/misc/imx8/scu_api.c b/drivers/misc/imx8/scu_api.c index a40c8badf9a..8985ab6584d 100644 --- a/drivers/misc/imx8/scu_api.c +++ b/drivers/misc/imx8/scu_api.c @@ -1282,8 +1282,7 @@ int sc_seco_secvio_dgo_config(sc_ipc_t ipc, u8 id, u8 access, u32 *data) printf("%s, id:0x%x, access:%x, res:%d\n", __func__, id, access, RPC_R8(&msg)); - if (data) - *data = RPC_U32(&msg, 0U); + *data = RPC_U32(&msg, 0U); return ret; } -- cgit v1.3.1 From 53158c8cf269f05c2d25769024cb0c363aac5e7a Mon Sep 17 00:00:00 2001 From: Andrew Goodbody Date: Tue, 5 Aug 2025 12:23:06 +0100 Subject: net: fec_mxc: Set error code on error exit In fecmxc_probe if a timeout is detected when resetting the chip no error code is set before taking the error exit. This could lead to a silent failure. Instead set an error code. This issue was found by Smatch. Signed-off-by: Andrew Goodbody --- drivers/net/fec_mxc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index 54b08482b91..9ac72d25ef6 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -1344,6 +1344,7 @@ static int fecmxc_probe(struct udevice *dev) while (readl(&priv->eth->ecntrl) & FEC_ECNTRL_RESET) { if (get_timer(start) > (CONFIG_SYS_HZ * 5)) { printf("FEC MXC: Timeout resetting chip\n"); + ret = -ETIMEDOUT; goto err_timeout; } udelay(10); -- cgit v1.3.1