Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89755dca authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Christoph Hellwig
Browse files

hfsplus: protect readdir against removals from open_dir_list



We already have i_mutex for readdir and the namespace operations that add
entries to open_dir_list, the only thing that was missing was the removal
in hfsplus_dir_release.

Signed-off-by: default avatarChristoph Hellwig <hch@tuxera.com>
parent 84adede3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -231,7 +231,9 @@ static int hfsplus_dir_release(struct inode *inode, struct file *file)
{
	struct hfsplus_readdir_data *rd = file->private_data;
	if (rd) {
		mutex_lock(&inode->i_mutex);
		list_del(&rd->list);
		mutex_unlock(&inode->i_mutex);
		kfree(rd);
	}
	return 0;