struct dlm_ctxt *dlm = data;
        struct dlm_unlock_lock *unlock = (struct dlm_unlock_lock *)msg->buf;
        struct dlm_lock_resource *res = NULL;
-       struct dlm_lock *lock = NULL;
+       struct dlm_lock *lock = NULL, *iter;
        enum dlm_status status = DLM_NORMAL;
-       int found = 0, i;
+       int i;
        struct dlm_lockstatus *lksb = NULL;
        int ignore;
        u32 flags;
        }
 
        queue=&res->granted;
-       found = 0;
        spin_lock(&res->spinlock);
        if (res->state & DLM_LOCK_RES_RECOVERING) {
                spin_unlock(&res->spinlock);
        }
 
        for (i=0; i<3; i++) {
-               list_for_each_entry(lock, queue, list) {
-                       if (lock->ml.cookie == unlock->cookie &&
-                           lock->ml.node == unlock->node_idx) {
-                               dlm_lock_get(lock);
-                               found = 1;
+               list_for_each_entry(iter, queue, list) {
+                       if (iter->ml.cookie == unlock->cookie &&
+                           iter->ml.node == unlock->node_idx) {
+                               dlm_lock_get(iter);
+                               lock = iter;
                                break;
                        }
                }
-               if (found)
+               if (lock)
                        break;
                /* scan granted -> converting -> blocked queues */
                queue++;
        }
        spin_unlock(&res->spinlock);
-       if (!found) {
+       if (!lock) {
                status = DLM_IVLOCKID;
                goto not_found;
        }
        dlm_kick_thread(dlm, res);
 
 not_found:
-       if (!found)
+       if (!lock)
                mlog(ML_ERROR, "failed to find lock to unlock! "
                               "cookie=%u:%llu\n",
                     dlm_get_lock_cookie_node(be64_to_cpu(unlock->cookie)),
 
 {
        struct mem_dqinfo *info = sb_dqinfo(sb, type);
        struct ocfs2_mem_dqinfo *oinfo = info->dqi_priv;
-       struct ocfs2_quota_chunk *chunk;
+       struct ocfs2_quota_chunk *chunk = NULL, *iter;
        struct ocfs2_local_disk_chunk *dchunk;
        int found = 0, len;
 
-       list_for_each_entry(chunk, &oinfo->dqi_chunk, qc_chunk) {
+       list_for_each_entry(iter, &oinfo->dqi_chunk, qc_chunk) {
                dchunk = (struct ocfs2_local_disk_chunk *)
-                                               chunk->qc_headerbh->b_data;
+                                               iter->qc_headerbh->b_data;
                if (le32_to_cpu(dchunk->dqc_free) > 0) {
-                       found = 1;
+                       chunk = iter;
                        break;
                }
        }
-       if (!found)
+       if (!chunk)
                return NULL;
 
        if (chunk->qc_num < oinfo->dqi_chunks - 1) {