diff mbox series

[v1,12/59] virtfs-proxy-helper.c: remove 'err_out' label in setugid()

Message ID 20200106182425.20312-13-danielhb413@gmail.com
State New
Headers show
Series trivial unneeded labels cleanup | expand

Commit Message

Daniel Henrique Barboza Jan. 6, 2020, 6:23 p.m. UTC
'err_out' can be removed and be replaced by 'return -errno'
in its only instance in the function.

CC: Greg Kurz <groug@kaod.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 fsdev/virtfs-proxy-helper.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Greg Kurz Jan. 7, 2020, 9:51 a.m. UTC | #1
On Mon,  6 Jan 2020 15:23:38 -0300
Daniel Henrique Barboza <danielhb413@gmail.com> wrote:

> 'err_out' can be removed and be replaced by 'return -errno'
> in its only instance in the function.
> 
> CC: Greg Kurz <groug@kaod.org>
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> ---

I don't really mind, but I confirm this doesn't change behavior.

Acked-by: Greg Kurz <groug@kaod.org>

What's the plan to get this and the other 9p related patches merged ?
Through the trivial tree or each subsystem tree ?

>  fsdev/virtfs-proxy-helper.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
> index 0d4de49dcf..aa1ab2590d 100644
> --- a/fsdev/virtfs-proxy-helper.c
> +++ b/fsdev/virtfs-proxy-helper.c
> @@ -287,8 +287,7 @@ static int setugid(int uid, int gid, int *suid, int *sgid)
>      *sgid = getegid();
>  
>      if (setresgid(-1, gid, *sgid) == -1) {
> -        retval = -errno;
> -        goto err_out;
> +        return -errno;
>      }
>  
>      if (setresuid(-1, uid, *suid) == -1) {
> @@ -322,7 +321,6 @@ err_sgid:
>      if (setresgid(-1, *sgid, *sgid) == -1) {
>          abort();
>      }
> -err_out:
>      return retval;
>  }
>
Markus Armbruster Jan. 13, 2020, 3:15 p.m. UTC | #2
Greg Kurz <groug@kaod.org> writes:

> On Mon,  6 Jan 2020 15:23:38 -0300
> Daniel Henrique Barboza <danielhb413@gmail.com> wrote:
>
>> 'err_out' can be removed and be replaced by 'return -errno'
>> in its only instance in the function.
>> 
>> CC: Greg Kurz <groug@kaod.org>
>> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
>> ---
>
> I don't really mind, but I confirm this doesn't change behavior.
>
> Acked-by: Greg Kurz <groug@kaod.org>
>
> What's the plan to get this and the other 9p related patches merged ?
> Through the trivial tree or each subsystem tree ?

I guess qemu-trivial will eventually pick up whatever hasn't been merged
by maintainers.

[...]
Laurent Vivier Jan. 13, 2020, 4:32 p.m. UTC | #3
Le 13/01/2020 à 16:15, Markus Armbruster a écrit :
> Greg Kurz <groug@kaod.org> writes:
> 
>> On Mon,  6 Jan 2020 15:23:38 -0300
>> Daniel Henrique Barboza <danielhb413@gmail.com> wrote:
>>
>>> 'err_out' can be removed and be replaced by 'return -errno'
>>> in its only instance in the function.
>>>
>>> CC: Greg Kurz <groug@kaod.org>
>>> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
>>> ---
>>
>> I don't really mind, but I confirm this doesn't change behavior.
>>
>> Acked-by: Greg Kurz <groug@kaod.org>
>>
>> What's the plan to get this and the other 9p related patches merged ?
>> Through the trivial tree or each subsystem tree ?
> 
> I guess qemu-trivial will eventually pick up whatever hasn't been merged
> by maintainers.
> 
> [...]
> 

Yes, but the difficulty will be to sort which ones of the 59 patches
series to collect...

Thanks,
Laurent
Greg Kurz Jan. 13, 2020, 7:56 p.m. UTC | #4
On Mon, 13 Jan 2020 17:32:31 +0100
Laurent Vivier <laurent@vivier.eu> wrote:

> Le 13/01/2020 à 16:15, Markus Armbruster a écrit :
> > Greg Kurz <groug@kaod.org> writes:
> > 
> >> On Mon,  6 Jan 2020 15:23:38 -0300
> >> Daniel Henrique Barboza <danielhb413@gmail.com> wrote:
> >>
> >>> 'err_out' can be removed and be replaced by 'return -errno'
> >>> in its only instance in the function.
> >>>
> >>> CC: Greg Kurz <groug@kaod.org>
> >>> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> >>> ---
> >>
> >> I don't really mind, but I confirm this doesn't change behavior.
> >>
> >> Acked-by: Greg Kurz <groug@kaod.org>
> >>
> >> What's the plan to get this and the other 9p related patches merged ?
> >> Through the trivial tree or each subsystem tree ?
> > 
> > I guess qemu-trivial will eventually pick up whatever hasn't been merged
> > by maintainers.
> > 
> > [...]
> > 
> 
> Yes, but the difficulty will be to sort which ones of the 59 patches
> series to collect...
> 

Ok, less work for you then. I've applied both 12/59 and 45/59 to 9p-next.
I'm planning to send a PR later this week.

> Thanks,
> Laurent
> 

Cheers,

--
Greg
Markus Armbruster Jan. 14, 2020, 7:55 a.m. UTC | #5
Laurent Vivier <laurent@vivier.eu> writes:

> Le 13/01/2020 à 16:15, Markus Armbruster a écrit :
>> Greg Kurz <groug@kaod.org> writes:
>> 
>>> On Mon,  6 Jan 2020 15:23:38 -0300
>>> Daniel Henrique Barboza <danielhb413@gmail.com> wrote:
>>>
>>>> 'err_out' can be removed and be replaced by 'return -errno'
>>>> in its only instance in the function.
>>>>
>>>> CC: Greg Kurz <groug@kaod.org>
>>>> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
>>>> ---
>>>
>>> I don't really mind, but I confirm this doesn't change behavior.
>>>
>>> Acked-by: Greg Kurz <groug@kaod.org>
>>>
>>> What's the plan to get this and the other 9p related patches merged ?
>>> Through the trivial tree or each subsystem tree ?
>> 
>> I guess qemu-trivial will eventually pick up whatever hasn't been merged
>> by maintainers.
>> 
>> [...]
>> 
>
> Yes, but the difficulty will be to sort which ones of the 59 patches
> series to collect...

Collect them all and let git figure out which ones have been applied
already?
diff mbox series

Patch

diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
index 0d4de49dcf..aa1ab2590d 100644
--- a/fsdev/virtfs-proxy-helper.c
+++ b/fsdev/virtfs-proxy-helper.c
@@ -287,8 +287,7 @@  static int setugid(int uid, int gid, int *suid, int *sgid)
     *sgid = getegid();
 
     if (setresgid(-1, gid, *sgid) == -1) {
-        retval = -errno;
-        goto err_out;
+        return -errno;
     }
 
     if (setresuid(-1, uid, *suid) == -1) {
@@ -322,7 +321,6 @@  err_sgid:
     if (setresgid(-1, *sgid, *sgid) == -1) {
         abort();
     }
-err_out:
     return retval;
 }