Merge tag 'char-misc-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
[linux-2.6-microblaze.git] / fs / ocfs2 / quota_local.c
index b1a8b04..5022b3e 100644 (file)
@@ -921,19 +921,19 @@ static struct ocfs2_quota_chunk *ocfs2_find_free_entry(struct super_block *sb,
 {
        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) {