Skip to content

Commit 554ceb7

Browse files
author
Al Viro
committed
o2hb_region_dev_store(): avoid goto around fdget()/fdput()
Preparation for CLASS(fd) conversion. Signed-off-by: Al Viro <[email protected]>
1 parent d7a9616 commit 554ceb7

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

fs/ocfs2/cluster/heartbeat.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,23 +1770,23 @@ static ssize_t o2hb_region_dev_store(struct config_item *item,
17701770
int live_threshold;
17711771

17721772
if (reg->hr_bdev_file)
1773-
goto out;
1773+
return -EINVAL;
17741774

17751775
/* We can't heartbeat without having had our node number
17761776
* configured yet. */
17771777
if (o2nm_this_node() == O2NM_MAX_NODES)
1778-
goto out;
1778+
return -EINVAL;
17791779

17801780
fd = simple_strtol(p, &p, 0);
17811781
if (!p || (*p && (*p != '\n')))
1782-
goto out;
1782+
return -EINVAL;
17831783

17841784
if (fd < 0 || fd >= INT_MAX)
1785-
goto out;
1785+
return -EINVAL;
17861786

17871787
f = fdget(fd);
17881788
if (fd_file(f) == NULL)
1789-
goto out;
1789+
return -EINVAL;
17901790

17911791
if (reg->hr_blocks == 0 || reg->hr_start_block == 0 ||
17921792
reg->hr_block_bytes == 0)
@@ -1908,7 +1908,6 @@ static ssize_t o2hb_region_dev_store(struct config_item *item,
19081908
}
19091909
out2:
19101910
fdput(f);
1911-
out:
19121911
return ret;
19131912
}
19141913

0 commit comments

Comments
 (0)