]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
imx: scu_api: Remove unnecessary NULL check
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Mon, 28 Jul 2025 16:42:21 +0000 (17:42 +0100)
committerFabio Estevam <festevam@gmail.com>
Thu, 7 Aug 2025 11:15:45 +0000 (08:15 -0300)
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 <andrew.goodbody@linaro.org>
drivers/misc/imx8/scu_api.c

index a40c8badf9ab61966b07cd1eec11ad2b14873858..8985ab6584d2052679a978887cd406a25b1a5670 100644 (file)
@@ -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;
 }