Re: [PATCH] crypto: rsa - remove unneeded initializations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 03/30/2018 08:27 PM, Herbert Xu wrote:
On Mon, Mar 26, 2018 at 02:59:06PM +0300, Tudor Ambarus wrote:
Remove useless assignment of ret to -ENOMEM in rsa_verify.
Remove useless initialization of ret to zero at declaration in
rsa_enc/dec/sign/verify.

Benefit of the power of undefined values and set ret in branches in
rsa_enc/dec/sign.

Reported-by: Benjamin Bales <techsupport@xxxxxxxxx>
Signed-off-by: Tudor Ambarus <tudor.ambarus@xxxxxxxxxxxxx>

The existing code looks fine.  If anything we should move the
assignments out of the if clause.

I set the err inside the if branch so that the compiler will
warn me in case of undefined value for err. Like here:

https://rusty.ozlabs.org/?p=232

Best,
ta



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux