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

Commit 2a117354 authored by Al Viro's avatar Al Viro
Browse files

switch o2hb_region_dev_write() to fget_light()



Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 7b540d06
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -1750,6 +1750,7 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg,
	struct inode *inode = NULL;
	struct inode *inode = NULL;
	ssize_t ret = -EINVAL;
	ssize_t ret = -EINVAL;
	int live_threshold;
	int live_threshold;
	int fput_needed;


	if (reg->hr_bdev)
	if (reg->hr_bdev)
		goto out;
		goto out;
@@ -1766,7 +1767,7 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg,
	if (fd < 0 || fd >= INT_MAX)
	if (fd < 0 || fd >= INT_MAX)
		goto out;
		goto out;


	filp = fget(fd);
	filp = fget_light(fd, &fput_needed);
	if (filp == NULL)
	if (filp == NULL)
		goto out;
		goto out;


@@ -1884,7 +1885,7 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg,


out:
out:
	if (filp)
	if (filp)
		fput(filp);
		fput_light(filp, fput_needed);
	if (inode)
	if (inode)
		iput(inode);
		iput(inode);
	if (ret < 0) {
	if (ret < 0) {