Re: [PATCH v2] crypto: cavium/nitrox - Fix 'nitrox_get_first_device()' when ndevlist is fully iterated

From: Herbert Xu
Date: Thu Jun 04 2020 - 08:19:02 EST


On Sat, May 30, 2020 at 03:35:37PM +0200, Christophe JAILLET wrote:
> When a list is completely iterated with 'list_for_each_entry(x, ...)', x is
> not NULL at the end.
>
> While at it, remove a useless initialization of the ndev variable. It
> is overridden by 'list_for_each_entry'.
>
> Fixes: f2663872f073 ("crypto: cavium - Register the CNN55XX supported crypto algorithms.")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
> ---
> v2: Do not introduce an extra variable to check if the list has been fully
> iterated. Test with "if (&ndev->list == &ndevlist)" instead
> ---
> drivers/crypto/cavium/nitrox/nitrox_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

Patch applied. Thanks.
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt