summaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visorbus/visorchipset.c
diff options
context:
space:
mode:
authorDavid Kershner2017-03-28 15:34:38 +0200
committerGreg Kroah-Hartman2017-03-29 09:17:03 +0200
commit3f49a21deca8452cafbf4c01ee98cdb4f4966b51 (patch)
tree63db27e8f05a9d81e9f262891890b004750776df /drivers/staging/unisys/visorbus/visorchipset.c
parentstaging: unisys: visornic: add error handling for visorchannel_signalinsert/r... (diff)
downloadkernel-qcow2-linux-3f49a21deca8452cafbf4c01ee98cdb4f4966b51.tar.gz
kernel-qcow2-linux-3f49a21deca8452cafbf4c01ee98cdb4f4966b51.tar.xz
kernel-qcow2-linux-3f49a21deca8452cafbf4c01ee98cdb4f4966b51.zip
staging: unisys: visorbus: add error handling for chipset_device_create
Adds error handling to the chipset_device_create message. If it returns a failure, it is assumed it has not signaled the s-Par firmware of the failure and the caller must do that. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys/visorbus/visorchipset.c')
-rw-r--r--drivers/staging/unisys/visorbus/visorchipset.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index d7ddf55f97c1..2582053aea3d 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -853,14 +853,14 @@ my_device_create(struct controlvm_message *inmsg)
spar_vhba_channel_protocol_uuid) == 0) {
err = save_crash_message(inmsg, CRASH_DEV);
if (err)
- goto err_free_dev_info;
+ goto err_destroy_visorchannel;
}
if (inmsg->hdr.flags.response_expected == 1) {
pmsg_hdr = kzalloc(sizeof(*pmsg_hdr), GFP_KERNEL);
if (!pmsg_hdr) {
err = -ENOMEM;
- goto err_free_dev_info;
+ goto err_destroy_visorchannel;
}
memcpy(pmsg_hdr, &inmsg->hdr,
@@ -868,11 +868,17 @@ my_device_create(struct controlvm_message *inmsg)
dev_info->pending_msg_hdr = pmsg_hdr;
}
/* Chipset_device_create will send response */
- chipset_device_create(dev_info);
+ err = chipset_device_create(dev_info);
+ if (err)
+ goto err_destroy_visorchannel;
+
POSTCODE_LINUX(DEVICE_CREATE_EXIT_PC, dev_no, bus_no,
DIAG_SEVERITY_PRINT);
return 0;
+err_destroy_visorchannel:
+ visorchannel_destroy(visorchannel);
+
err_free_dev_info:
kfree(dev_info);