aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visornic
diff options
context:
space:
mode:
authorDavid Binder <david.binder@unisys.com>2016-05-12 09:14:46 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-06-07 22:55:19 -0700
commitd12324e37d4f384b93df65d5188a1875ee80ed4c (patch)
treeb0785f0e9ffeb90130ee0cfb3a8182a60e635707 /drivers/staging/unisys/visornic
parentstaging: unisys: visornic: simplify visornic if statements (diff)
downloadlinux-dev-d12324e37d4f384b93df65d5188a1875ee80ed4c.tar.xz
linux-dev-d12324e37d4f384b93df65d5188a1875ee80ed4c.zip
staging: unisys: visornic: cleanup error handling
Adjusts goto labels to prevent attempts to free unallocated resources. Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys/visornic')
-rw-r--r--drivers/staging/unisys/visornic/visornic_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c
index 992543ae2c93..f5561008e592 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -1796,7 +1796,7 @@ static int visornic_probe(struct visor_device *dev)
sizeof(struct sk_buff *), GFP_KERNEL);
if (!devdata->rcvbuf) {
err = -ENOMEM;
- goto cleanup_rcvbuf;
+ goto cleanup_netdev;
}
/* set the net_xmit outstanding threshold */
@@ -1817,12 +1817,12 @@ static int visornic_probe(struct visor_device *dev)
devdata->cmdrsp_rcv = kmalloc(SIZEOF_CMDRSP, GFP_ATOMIC);
if (!devdata->cmdrsp_rcv) {
err = -ENOMEM;
- goto cleanup_cmdrsp_rcv;
+ goto cleanup_rcvbuf;
}
devdata->xmit_cmdrsp = kmalloc(SIZEOF_CMDRSP, GFP_ATOMIC);
if (!devdata->xmit_cmdrsp) {
err = -ENOMEM;
- goto cleanup_xmit_cmdrsp;
+ goto cleanup_cmdrsp_rcv;
}
INIT_WORK(&devdata->timeout_reset, visornic_timeout_reset);
devdata->server_down = false;