rx: Fix wrong loop iterator in rx_clearProcessRPCStats
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 12 Feb 2013 13:04:01 +0000 (13:04 +0000)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 24 Feb 2013 19:22:49 +0000 (11:22 -0800)
Fix the use of an incorrect variable as loop iterator which would have
resulted in a crash.

Caught by clang analyzer.

Change-Id: I785d06b9be0915bc540c37b43d1001a562a7cde4
Reviewed-on: http://gerrit.openafs.org/9202
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/rx/rx.c

index 5113ac5..36ad89f 100644 (file)
@@ -9124,7 +9124,7 @@ rx_clearProcessRPCStats(afs_uint32 clearFlag)
     for (opr_queue_Scan(&processStats, cursor)) {
        unsigned int num_funcs = 0, i;
        struct rx_interface_stat *rpc_stat
-            = opr_queue_Entry(rpc_stat, struct rx_interface_stat, entry);
+            = opr_queue_Entry(cursor, struct rx_interface_stat, entry);
 
        num_funcs = rpc_stat->stats[0].func_total;
        for (i = 0; i < num_funcs; i++) {