When queue_Scan is executed on an empty queue the queue element
variable, in this case 'rpc_stat' is the queue head, _RXQ(q),
and not NULL. Callers of rxi_FindRpcStat() expect NULL on failure
to find or create an rx_interface_stat object. Correct the behavior
by testing for an empty queue and return NULL immediately if the
queue is empty and the caller is not requesting creation.
Change-Id: I9952d7aaf357e039e87f6b8b17cb1a00208d6465
Reviewed-on: http://gerrit.openafs.org/7835
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
unsigned int *counter, int create)
{
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
*/