OSDN Git Service

staging: unisys: visorbus: Add err handling for function save_crash_message
authorDavid Kershner <david.kershner@unisys.com>
Thu, 22 Dec 2016 16:09:05 +0000 (11:09 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Jan 2017 14:19:06 +0000 (15:19 +0100)
The function save_crash_message returns an error, don't ignore it,
respond appropriately and send it up.

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

index 27f52ca..6343cb0 100644 (file)
@@ -728,8 +728,11 @@ bus_create(struct controlvm_message *inmsg)
 
        POSTCODE_LINUX(BUS_CREATE_ENTRY_PC, 0, bus_no, DIAG_SEVERITY_PRINT);
 
-       if (uuid_le_cmp(cmd->create_bus.bus_inst_uuid, spar_siovm_uuid) == 0)
-               save_crash_message(inmsg, CRASH_BUS);
+       if (uuid_le_cmp(cmd->create_bus.bus_inst_uuid, spar_siovm_uuid) == 0) {
+               err = save_crash_message(inmsg, CRASH_BUS);
+               if (err)
+                       goto err_free_bus_info;
+       }
 
        if (inmsg->hdr.flags.response_expected == 1) {
                pmsg_hdr = kzalloc(sizeof(*pmsg_hdr),