Re: [PATCH spice-server 5/6] spicevmc: Remove useless check

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

 



On 01/26/2017 12:56 PM, Frediano Ziglio wrote:
rcc is already deferenced in red_channel_client_get_client so
checking for NULL after that is uselss.

Hi Frediano,

On one hand you're right, it is useless to check if a pointer
is NULL after it was dereferenced.
On the other hand maybe that's wrong and we
should move the call to red_channel_client_get_client
after checking rcc.

It seems to me it's safe to assume rcc is not NULL
here.
I looked at other on_disconnect callbacks, some do
check rcc some don't.

Uri.


Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/spicevmc.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/server/spicevmc.c b/server/spicevmc.c
index f441822..2039a80 100644
--- a/server/spicevmc.c
+++ b/server/spicevmc.c
@@ -452,10 +452,6 @@ static void spicevmc_red_channel_client_on_disconnect(RedChannelClient *rcc)
     SpiceCharDeviceInterface *sif;
     RedClient *client = red_channel_client_get_client(rcc);

-    if (!rcc) {
-        return;
-    }
-
     channel = RED_VMC_CHANNEL(red_channel_client_get_channel(rcc));

     /* partial message which wasn't pushed to device */


_______________________________________________
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]