[PATCH v3 0/3] ti_sci: Address some issues found by Smatch

Nishanth Menon nm at ti.com
Wed Oct 8 14:26:02 CEST 2025


On 10:23-20251008, Andrew Goodbody wrote:
> Prevent a memory leak from a non-freed malloc.
> Return an error code on an error path.
> Assign a value to a pointer before it is dereferenced.
> 
> Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org>
> ---
> Changes in v3:
> - Pick up review tags
> - Change dev_dbg call to dev_err to be consistent with surrounding code
>   in 2/3
> - Update subject line of 3/3 to be more explicit
> - Link to v2: https://lore.kernel.org/r/20251007-ti_sci-v2-0-7561d7ea07b2@linaro.org
> 
> Changes in v2:
> - Add cast when assigning to resp
> - Replace malloc with devm_kmalloc
> - Link to v1: https://lore.kernel.org/r/20251006-ti_sci-v1-0-9cef92e1022d@linaro.org
> 
> ---
> Andrew Goodbody (3):
>       ti_sci: Prevent memory leak
>       ti_sci: Provide error code on error exit
>       ti_sci: Pointer is never assigned to valid value
> 
>  drivers/firmware/ti_sci.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> ---
> base-commit: c280c4f7e52f08255f491783b3143a3be1fc08b0
> change-id: 20250725-ti_sci-7bc55cb0cdba
> 
> Best regards,
> -- 
> Andrew Goodbody <andrew.goodbody at linaro.org>
> 

Reviewed-by: Nishanth Menon <nm at ti.com>

Also tested with UART boot against u-boot master commit 92dcb3ad5d98  ("cmd/dma: implement dmareset command")


https://gist.github.com/nmenon/1f569681f43cfed456fcce729e0c6e29

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
https://ti.com/opensource


More information about the U-Boot mailing list