Acked-by: Christophe Fergeau <cfergeau@xxxxxxxxxx> On Tue, Nov 15, 2016 at 12:26:55AM +0100, Victor Toso wrote: > From: Victor Toso <me@xxxxxxxxxxxxxx> > > As spice_usb_device_manager_get() can be NULL > Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx> > --- > src/channel-usbredir.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c > index add7d5e..4837d68 100644 > --- a/src/channel-usbredir.c > +++ b/src/channel-usbredir.c > @@ -293,6 +293,7 @@ static gboolean spice_usbredir_channel_open_device( > SpiceSession *session; > libusb_device_handle *handle = NULL; > int rc, status; > + SpiceUsbDeviceManager *manager; > > g_return_val_if_fail(priv->state == STATE_DISCONNECTED > #ifdef USE_POLKIT > @@ -317,7 +318,10 @@ static gboolean spice_usbredir_channel_open_device( > } > > session = spice_channel_get_session(SPICE_CHANNEL(channel)); > - priv->usb_device_manager = g_object_ref(spice_usb_device_manager_get(session, NULL)); > + manager = spice_usb_device_manager_get(session, NULL); > + g_return_val_if_fail(manager != NULL, FALSE); > + > + priv->usb_device_manager = g_object_ref(manager); > if (!spice_usb_device_manager_start_event_listening(priv->usb_device_manager, err)) { > usbredirhost_set_device(priv->host, NULL); > return FALSE; > -- > 2.9.3 > > _______________________________________________ > Spice-devel mailing list > Spice-devel@xxxxxxxxxxxxxxxxxxxxx > https://lists.freedesktop.org/mailman/listinfo/spice-devel
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel