[Spice-devel] [spice-server v2 2/4] smartcard: Remove redundant test in smartcard_char_device_on_message_from_device()

Christophe Fergeau cfergeau at redhat.com
Fri Feb 8 16:26:25 UTC 2019


The function returns NULL if vheader->type is VSC_Init so no need to
check it a second time.

Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
---
 server/smartcard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/smartcard.c b/server/smartcard.c
index 21dc8de5a..39ada9c28 100644
--- a/server/smartcard.c
+++ b/server/smartcard.c
@@ -207,7 +207,7 @@ RedMsgItem *smartcard_char_device_on_message_from_device(RedCharDeviceSmartcard
             break;
     }
     /* We pass any VSC_Error right now - might need to ignore some? */
-    if (dev->priv->reader_id == VSCARD_UNDEFINED_READER_ID && vheader->type != VSC_Init) {
+    if (dev->priv->reader_id == VSCARD_UNDEFINED_READER_ID) {
         red_channel_warning(red_channel_client_get_channel(RED_CHANNEL_CLIENT(dev->priv->scc)),
                             "error: reader_id not assigned for message of type %d",
                             vheader->type);
-- 
2.20.1



More information about the Spice-devel mailing list