Re: [PATCH] crypto: lib/mpi - Fix an "Uninitialized scalar variable" issue

From: Kamlesh Gurudasani
Date: Sun Sep 15 2024 - 11:46:37 EST


Qianqiang Liu <qianqiang.liu@xxxxxxx> writes:

> On Fri, Sep 13, 2024 at 10:07:42PM +0800, Qianqiang Liu wrote:
>> The "err" variable may be returned without an initialized value.
>>
>> Fixes: 8e3a67f2de87 ("crypto: lib/mpi - Add error checks to extension")
>> Signed-off-by: Qianqiang Liu <qianqiang.liu@xxxxxxx>
Thanks for the patch.

You can update the commit message and subject line to be more specific.

***
example
Subject: crypto: lib/mpi - Fix return of uninitailized variable err

If no error occurs, "err" variable will be returned with uninitialized
value, which is actually a success case scenario and return value should
have been zero.
***

This makes the need of entire fix more clear.
I think currently no body is checking return value of this function as
this is recent introduction or this would have failed.

Kamlesh