aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lnet/selftest/conrpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/lustre/lnet/selftest/conrpc.c')
-rw-r--r--drivers/staging/lustre/lnet/selftest/conrpc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
index 32970ef777e3..5604fceb1a41 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
@@ -1335,6 +1335,7 @@ lstcon_rpc_cleanup_wait(void)
{
lstcon_rpc_trans_t *trans;
lstcon_rpc_t *crpc;
+ lstcon_rpc_t *temp;
struct list_head *pacer;
struct list_head zlist;
@@ -1374,9 +1375,7 @@ lstcon_rpc_cleanup_wait(void)
spin_unlock(&console_session.ses_rpc_lock);
- while (!list_empty(&zlist)) {
- crpc = list_entry(zlist.next, lstcon_rpc_t, crp_link);
-
+ list_for_each_entry_safe(crpc, temp, &zlist, crp_link) {
list_del(&crpc->crp_link);
LIBCFS_FREE(crpc, sizeof(lstcon_rpc_t));
}