Hi Pascal,

On Tue, Jul 02, 2019 at 04:39:53PM +0200, Pascal van Leeuwen wrote:
> From: Pascal van Leeuwen <[email protected]>
> 
> diff --git a/drivers/crypto/inside-secure/safexcel.c 
> b/drivers/crypto/inside-secure/safexcel.c
> index 503fef0..8e8c01d 100644
> --- a/drivers/crypto/inside-secure/safexcel.c
> +++ b/drivers/crypto/inside-secure/safexcel.c
> @@ -694,16 +694,31 @@ void safexcel_dequeue(struct safexcel_crypto_priv 
> *priv, int ring)
>  inline int safexcel_rdesc_check_errors(struct safexcel_crypto_priv *priv,
>                                      struct safexcel_result_desc *rdesc)
>  {
> -     if (likely(!rdesc->result_data.error_code))
> +     if (likely((!rdesc->descriptor_overflow) &&
> +                (!rdesc->buffer_overflow) &&
> +                (!rdesc->result_data.error_code)))

You don't need the extra () here.

> +     if (rdesc->descriptor_overflow)
> +             dev_err(priv->dev, "Descriptor overflow detected");
> +
> +     if (rdesc->buffer_overflow)
> +             dev_err(priv->dev, "Buffer overflow detected");

You're not returning an error here, is there a reason for that?

I also remember having issues when adding those checks a while ago, Did
you see any of those two error messages when using the crypto engine?

Thanks!
Antoine

-- 
Antoine Ténart, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Reply via email to