Blame SOURCES/0014-Remove-some-warnings-from-Clang-static-analyzer.patch

7492b2
From 95f6f22c4fee847cdf84465107561b94a5c10782 Mon Sep 17 00:00:00 2001
7492b2
From: Frediano Ziglio <freddy77@gmail.com>
7492b2
Date: Thu, 27 Aug 2020 17:20:06 +0100
7492b2
Subject: [PATCH] Remove some warnings from Clang static analyzer
7492b2
7492b2
qmp-port.c:
7492b2
warning: Although the value stored to 'node' is used in the enclosing
7492b2
expression, the value is never actually read from 'node'
7492b2
7492b2
usb-backend.c:
7492b2
warning: Value stored to 'done' is never read
7492b2
warning: Use of memory after it is freed
7492b2
7492b2
usb-device-cd.c:
7492b2
warning: Value stored to 'error' is never read
7492b2
7492b2
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
7492b2
---
7492b2
 src/qmp-port.c      | 2 +-
7492b2
 src/usb-backend.c   | 3 +--
7492b2
 src/usb-device-cd.c | 2 +-
7492b2
 3 files changed, 3 insertions(+), 4 deletions(-)
7492b2
7492b2
diff --git a/src/qmp-port.c b/src/qmp-port.c
7492b2
index 25ab1d1..f0cbbc7 100644
7492b2
--- a/src/qmp-port.c
7492b2
+++ b/src/qmp-port.c
7492b2
@@ -104,7 +104,7 @@ spice_qmp_dispatch_message(SpiceQmpPort *self)
7492b2
         return TRUE;
7492b2
     }
7492b2
 
7492b2
-    if ((node = json_object_get_member(obj, "error"))) {
7492b2
+    if (json_object_get_member(obj, "error") != NULL) {
7492b2
         gint id = json_object_get_int_member(obj, "id");
7492b2
         const gchar *desc = json_object_get_string_member(obj, "desc");
7492b2
 
7492b2
diff --git a/src/usb-backend.c b/src/usb-backend.c
7492b2
index 5d3912b..a4a5f0a 100644
7492b2
--- a/src/usb-backend.c
7492b2
+++ b/src/usb-backend.c
7492b2
@@ -867,7 +867,6 @@ usbredir_control_packet(void *priv, uint64_t id, struct usb_redir_control_packet
7492b2
 
7492b2
     if (!done) {
7492b2
         device_ops(edev)->control_request(edev, data, data_len, &response, &out_buffer);
7492b2
-        done = TRUE;
7492b2
     }
7492b2
 
7492b2
     if (response.status) {
7492b2
@@ -1367,8 +1366,8 @@ void spice_usb_backend_channel_delete(SpiceUsbBackendChannel *ch)
7492b2
         free(ch->rules);
7492b2
     }
7492b2
 
7492b2
+    SPICE_DEBUG("%s << %p", __FUNCTION__, ch);
7492b2
     g_free(ch);
7492b2
-    SPICE_DEBUG("%s << %p", __FUNCTION__, ch);
7492b2
 }
7492b2
 
7492b2
 void
7492b2
diff --git a/src/usb-device-cd.c b/src/usb-device-cd.c
7492b2
index 1aa553a..b9fa317 100644
7492b2
--- a/src/usb-device-cd.c
7492b2
+++ b/src/usb-device-cd.c
7492b2
@@ -150,7 +150,7 @@ static int cd_device_load(SpiceCdLU *unit, gboolean load)
7492b2
     if (load) {
7492b2
         error = ioctl(fd, CDROMCLOSETRAY, 0);
7492b2
     } else {
7492b2
-        error = ioctl(fd, CDROM_LOCKDOOR, 0);
7492b2
+        ioctl(fd, CDROM_LOCKDOOR, 0);
7492b2
         error = ioctl(fd, CDROMEJECT, 0);
7492b2
     }
7492b2
     if (error) {
7492b2
-- 
7492b2
2.28.0
7492b2