From: Derrick Brashear Date: Sun, 6 Nov 2011 21:28:27 +0000 (-0500) Subject: dafs: avoid null deref getting volume header X-Git-Tag: openafs-stable-1_8_0pre1~3074 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=00beae8c4e3b390637f20584e676cf86c817dadd dafs: avoid null deref getting volume header we don't assign hd before dereferencing. stop dereferencing and just use the queue cursor. Change-Id: I023fd959c5d49575dbdf89fd4dab77341c5c52d0 Reviewed-on: http://gerrit.openafs.org/5814 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Derrick Brashear --- diff --git a/src/vol/volume.c b/src/vol/volume.c index 287041e..319aeab 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -7929,7 +7929,7 @@ GetVolHeaderFromLRU(void) * could VWaitExclusiveState_r instead, but not waiting is faster and * easier to do */ for (queue_Scan(&volume_hdr_LRU, qh, nqh, volHeader)) { - if (!hd->back || !VIsExclusiveState(V_attachState(hd->back))) { + if (!qh->back || !VIsExclusiveState(V_attachState(qh->back))) { queue_Remove(qh); hd = qh; break;