mirror of
https://git.openafs.org/openafs.git
synced 2025-01-21 08:20:16 +00:00
vol: Don't return an uninited val from LookupNode
If the SalvageHashTable for a particular node is empty, then LookupNode can return an uninitialised value to the caller. It isn't clear from a broader code inspection whether LookupNode can ever be called with an empty SalvageHashTable, but returning a NULL vsp does seem like the correct thing to do in this situation. Caught by clang-analyzer Change-Id: Ibee79e6acf7d3bdbc2995ef924338ade4de77d08 Reviewed-on: http://gerrit.openafs.org/7094 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
parent
9cbc3b77db
commit
6c1a7e68c4
@ -188,7 +188,7 @@ LookupNode(afs_uint32 vid, char * partName,
|
|||||||
struct SalvageQueueNode ** parent)
|
struct SalvageQueueNode ** parent)
|
||||||
{
|
{
|
||||||
struct rx_queue *qp, *nqp;
|
struct rx_queue *qp, *nqp;
|
||||||
struct SalvageQueueNode *vsp;
|
struct SalvageQueueNode *vsp = NULL;
|
||||||
int idx = VSHASH(vid);
|
int idx = VSHASH(vid);
|
||||||
|
|
||||||
for (queue_Scan(&SalvageHashTable[idx], qp, nqp, rx_queue)) {
|
for (queue_Scan(&SalvageHashTable[idx], qp, nqp, rx_queue)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user