On Thu, Jan 15, 2026 at 04:28:48PM +0800, Jianping Li wrote:
> From: Ekansh Gupta <[email protected]>
> 
> The fastrpc_buf_free function currently does not handle the case where
> the input buffer pointer (buf) is NULL. This can lead to a null pointer
> dereference, causing a crash or undefined behavior when the function
> attempts to access members of the buf structure. Add a NULL check to
> ensure safe handling of NULL pointers and prevent potential crashes.

When does it happen? Do you have a backtrace or is it a safety coding?
Do you pass NULL buffer pointers to the function?

> 
> Fixes: c68cfb718c8f9 ("misc: fastrpc: Add support for context Invoke method")
> Cc: [email protected]
> Co-developed-by: Ekansh Gupta <[email protected]>
> Signed-off-by: Ekansh Gupta <[email protected]>
> Signed-off-by: Jianping Li <[email protected]>
> ---
>  drivers/misc/fastrpc.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 

-- 
With best wishes
Dmitry

Reply via email to