Fix missing unlock_kernel()s Someone just slapped lock_kernel()/unlock_kernel() around this function and missed the hidden evil multiple return statements. fs/affs/dir.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff -puN fs/affs/dir.c~affs-lock_kernel-fix fs/affs/dir.c --- 25/fs/affs/dir.c~affs-lock_kernel-fix 2003-03-15 02:45:49.000000000 -0800 +++ 25-akpm/fs/affs/dir.c 2003-03-15 02:50:31.000000000 -0800 @@ -77,14 +77,18 @@ affs_readdir(struct file *filp, void *di if (f_pos == 0) { filp->private_data = (void *)0; - if (filldir(dirent, ".", 1, f_pos, inode->i_ino, DT_DIR) < 0) - return 0; + if (filldir(dirent, ".", 1, f_pos, inode->i_ino, DT_DIR) < 0) { + ret = 0; + goto out; + } filp->f_pos = f_pos = 1; stored++; } if (f_pos == 1) { - if (filldir(dirent, "..", 2, f_pos, parent_ino(filp->f_dentry), DT_DIR) < 0) - return stored; + if (filldir(dirent, "..", 2, f_pos, parent_ino(filp->f_dentry), DT_DIR) < 0) { + res = stored; + goto out; + } filp->f_pos = f_pos = 2; stored++; } @@ -162,6 +166,7 @@ readdir_out: affs_brelse(dir_bh); affs_brelse(fh_bh); affs_unlock_dir(inode); +out: unlock_kernel(); pr_debug("AFFS: readdir()=%d\n", stored); return res; _