Re: [PATCH 1/1] crypto: asymmetric_keys: set error code on failure

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

 



Pan Bian <bianpan201602@xxxxxxx> wrote:

>  	outlen = crypto_akcipher_maxsize(tfm);
>  	output = kmalloc(outlen, GFP_KERNEL);
> -	if (!output)
> +	if (!output) {
> +		ret = -ENOMEM;
>  		goto error_free_req;
> +	}

This is preferred:

+	ret = -ENOMEM;
 	outlen = crypto_akcipher_maxsize(tfm);
 	output = kmalloc(outlen, GFP_KERNEL);
 	if (!output)
 		goto error_free_req;

I'll alter your patch.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



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

  Powered by Linux