]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
staging: unisys: visorbus: device_changestate_responder add error handling
authorDavid Kershner <david.kershner@unisys.com>
Mon, 21 Nov 2016 17:15:50 +0000 (12:15 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Nov 2016 09:01:57 +0000 (10:01 +0100)
Pass the error returned from visorchannel_signalinsert up the stack
instead of just ignoring it.

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 a10e41aa5d62f36ca199ce6d260402326d6206c8..f740b52482cd8086f1b3fb8a5b1b6ae3daad59c5 100644 (file)
@@ -652,7 +652,7 @@ bus_responder(enum controlvm_id cmd_id,
        return controlvm_respond(pending_msg_hdr, response);
 }
 
-static void
+static int
 device_changestate_responder(enum controlvm_id cmd_id,
                             struct visor_device *p, int response,
                             struct spar_segment_state response_state)
@@ -662,9 +662,9 @@ device_changestate_responder(enum controlvm_id cmd_id,
        u32 dev_no = p->chipset_dev_no;
 
        if (!p->pending_msg_hdr)
-               return;         /* no controlvm response needed */
+               return -EIO;
        if (p->pending_msg_hdr->id != cmd_id)
-               return;
+               return -EINVAL;
 
        controlvm_init_response(&outmsg, p->pending_msg_hdr, response);
 
@@ -672,9 +672,8 @@ device_changestate_responder(enum controlvm_id cmd_id,
        outmsg.cmd.device_change_state.dev_no = dev_no;
        outmsg.cmd.device_change_state.state = response_state;
 
-       if (visorchannel_signalinsert(controlvm_channel,
-                                     CONTROLVM_QUEUE_REQUEST, &outmsg))
-               return;
+       return visorchannel_signalinsert(controlvm_channel,
+                                        CONTROLVM_QUEUE_REQUEST, &outmsg);
 }
 
 static void