staging: unisys: visorbus: device_responder add error handling
authorDavid Kershner <david.kershner@unisys.com>
Mon, 21 Nov 2016 17:15:51 +0000 (12:15 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Nov 2016 09:01:57 +0000 (10:01 +0100)
The function controlvm_respond returns proper error handling, so now we
can propagate the error up and handle it appropriately.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorbus/visorchipset.c

index f740b52482cd8086f1b3fb8a5b1b6ae3daad59c5..50e245ed23e9923d67ef24dd7d7972b19dc2d59d 100644 (file)
@@ -676,18 +676,18 @@ device_changestate_responder(enum controlvm_id cmd_id,
                                         CONTROLVM_QUEUE_REQUEST, &outmsg);
 }
 
-static void
+static int
 device_responder(enum controlvm_id cmd_id,
                 struct controlvm_message_header *pending_msg_hdr,
                 int response)
 {
        if (!pending_msg_hdr)
-               return;         /* no controlvm response needed */
+               return -EIO;
 
        if (pending_msg_hdr->id != (u32)cmd_id)
-               return;
+               return -EINVAL;
 
-       controlvm_respond(pending_msg_hdr, response);
+       return controlvm_respond(pending_msg_hdr, response);
 }
 
 static int