From 2542e5134d2c19a9e6a4e641ef78cac6bccebd9b Mon Sep 17 00:00:00 2001 From: Cesar Eduardo Barros Date: Tue, 22 Mar 2011 16:33:18 -0700 Subject: sys_swapon: simplify error return from swap_info allocation At this point in sys_swapon, there is nothing to free. Return directly instead of jumping to the cleanup block at the end of the function. Signed-off-by: Cesar Eduardo Barros Tested-by: Eric B Munson Acked-by: Eric B Munson Reviewed-by: Pekka Enberg Reviewed-by: KAMEZAWA Hiroyuki Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/swapfile.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'mm/swapfile.c') diff --git a/mm/swapfile.c b/mm/swapfile.c index 6d1c3c67ae65..4d457d699c1f 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -1918,10 +1918,8 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) return -EPERM; p = alloc_swap_info(); - if (IS_ERR(p)) { - error = PTR_ERR(p); - goto out; - } + if (IS_ERR(p)) + return PTR_ERR(p); name = getname(specialfile); error = PTR_ERR(name); -- cgit v1.2.2