From 00e1e727184e8497de098d3cb9da88ca2592879e Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 4 Sep 2012 00:05:52 +0000 Subject: [PATCH] scst_user: Change a goto statement into an explicit loop Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4505 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_user.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c index aaf720d03..3724b8640 100644 --- a/scst/src/dev_handlers/scst_user.c +++ b/scst/src/dev_handlers/scst_user.c @@ -3576,13 +3576,12 @@ static int dev_user_process_cleanup(struct scst_user_dev *dev) int i; for (i = 0; i < (int)ARRAY_SIZE(dev->ucmd_hash); i++) { struct list_head *head = &dev->ucmd_hash[i]; - struct scst_user_cmd *ucmd2; -again: - list_for_each_entry(ucmd2, head, hash_list_entry) { + struct scst_user_cmd *ucmd2, *tmp; + + list_for_each_entry_safe(ucmd2, tmp, head, hash_list_entry) { PRINT_ERROR("Lost ucmd %p (state %x, ref %d)", ucmd2, ucmd2->state, atomic_read(&ucmd2->ucmd_ref)); ucmd_put(ucmd2); - goto again; } } }