Re: [PATCH spice-server] spicevmc: Check correctly rcc argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> Do not check rcc after being use but before.
> 
> Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> ---
>  server/spicevmc.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/server/spicevmc.c b/server/spicevmc.c
> index 064910e..df776f4 100644
> --- a/server/spicevmc.c
> +++ b/server/spicevmc.c
> @@ -450,12 +450,11 @@ static void
> spicevmc_red_channel_client_on_disconnect(RedChannelClient *rcc)
>  {
>      RedVmcChannel *channel;
>      SpiceCharDeviceInterface *sif;
> -    RedClient *client = red_channel_client_get_client(rcc);
> +    RedClient *client;
>  
> -    if (!rcc) {
> -        return;
> -    }
> +    g_return_if_fail(rcc != NULL);
>  
> +    client = red_channel_client_get_client(rcc);
>      channel = RED_VMC_CHANNEL(red_channel_client_get_channel(rcc));
>  
>      /* partial message which wasn't pushed to device */

I prefer the version removing the NULL check.

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]