ti_sci: Pointer is never assigned to valid value
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Wed, 8 Oct 2025 09:23:37 +0000 (10:23 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 16 Oct 2025 21:02:14 +0000 (15:02 -0600)
The pointer resp is declared but never assigned a value but is then
dereferenced. Fix this by assigning the pointer to the message buffer.

This issue was found by Smatch.

Reviewed-by: Udit Kumar <u-kumar1@ti.com>
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: Anshul Dalal <anshuld@ti.com>
drivers/firmware/ti_sci.c

index 534326b..6f57dcf 100644 (file)
@@ -1365,6 +1365,8 @@ static int ti_sci_cmd_clk_get_parent(const struct ti_sci_handle *handle,
        if (ret)
                return ret;
 
+       resp = (struct ti_sci_msg_resp_get_clock_parent *)xfer->tx_message.buf;
+
        *parent_id = resp->parent_id;
 
        return ret;