From 300dd717fa57df77175807cf7cf6be36cb1f9fef Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 26 Jul 2012 18:35:48 -0400 Subject: [PATCH] rx: better rxi_FindRpcStat check for end of queue patchset 1f0cf8b2b4bb6e36d8d82323a15ced72d91db0ec tested for an empty queue but what is really required is a test for end of queue after the queue_Scan(). If the queue_Scan() completes at the end of the queue, in other words, pointing at the list head, then return NULL because no match was found. Change-Id: I444531d3cfa85b4691eaa8960da0266de82a03a3 Reviewed-on: http://gerrit.openafs.org/7886 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/rx/rx.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/rx/rx.c b/src/rx/rx.c index 4689bea9a..e344db5b9 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -8112,9 +8112,6 @@ rxi_FindRpcStat(struct rx_queue *stats, afs_uint32 rxInterface, { rx_interface_stat_p rpc_stat, nrpc_stat; - if (queue_IsEmpty(stats) && !create) - return NULL; - /* * See if there's already a structure for this interface */ @@ -8126,8 +8123,12 @@ rxi_FindRpcStat(struct rx_queue *stats, afs_uint32 rxInterface, } /* if they didn't ask us to create, we're done */ - if (!create) - return rpc_stat; + if (!create) { + if (queue_IsEnd(stats, rpc_stat)) + return NULL; + else + return rpc_stat; + } /* can't proceed without these */ if (!totalFunc || !counter) -- 2.39.5