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

From
Herbert Xu <herbert@gondor.apana.org.au>
Date
2020-06-04 12:19:01
Also in
kernel-janitors, lkml
Reply to
Christophe JAILLET, 2020-05-30
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 <redacted>
---
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 [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Thread (2 messages) 2 messages, 2 authors, last reply 2020-06-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help