[spice-gtk,v1,4/6] channel-main: remove redundant if on SpiceSession creation

Submitted by Victor Toso on Sept. 24, 2019, 9:15 a.m.

Details

Message ID 20190924091502.16038-5-victortoso@redhat.com
State New
Headers show
Series "migration object" ( rev: 2 1 ) in Spice

Not browsing as part of any series.

Commit Message

Victor Toso Sept. 24, 2019, 9:15 a.m.
From: Victor Toso <me@victortoso.com>

As spice_session_set_migration_session() does check with
SPICE_IS_SESSION() and would log a critical in case it is NULL, which
is better than just silent fail migration

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 src/channel-main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/channel-main.c b/src/channel-main.c
index a0ab520..3fe8d64 100644
--- a/src/channel-main.c
+++ b/src/channel-main.c
@@ -2359,10 +2359,9 @@  static void main_migrate_connect(SpiceChannel *channel,
     CHANNEL_DEBUG(channel, "migrate connect");
     session = spice_channel_get_session(channel);
     mig.session = spice_session_new_from_session(session);
-    if (mig.session == NULL)
-        goto end;
-    if (!spice_session_set_migration_session(session, mig.session))
+    if (!spice_session_set_migration_session(session, mig.session)) {
         goto end;
+    }
 
     main_priv->migrate_data = &mig;