Commit d12324e3 authored by David Binder's avatar David Binder Committed by Greg Kroah-Hartman

staging: unisys: visornic: cleanup error handling

Adjusts goto labels to prevent attempts to free unallocated resources.
Signed-off-by: default avatarDavid Binder <david.binder@unisys.com>
Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6d8c96cb
...@@ -1796,7 +1796,7 @@ static int visornic_probe(struct visor_device *dev) ...@@ -1796,7 +1796,7 @@ static int visornic_probe(struct visor_device *dev)
sizeof(struct sk_buff *), GFP_KERNEL); sizeof(struct sk_buff *), GFP_KERNEL);
if (!devdata->rcvbuf) { if (!devdata->rcvbuf) {
err = -ENOMEM; err = -ENOMEM;
goto cleanup_rcvbuf; goto cleanup_netdev;
} }
/* set the net_xmit outstanding threshold */ /* set the net_xmit outstanding threshold */
...@@ -1817,12 +1817,12 @@ static int visornic_probe(struct visor_device *dev) ...@@ -1817,12 +1817,12 @@ static int visornic_probe(struct visor_device *dev)
devdata->cmdrsp_rcv = kmalloc(SIZEOF_CMDRSP, GFP_ATOMIC); devdata->cmdrsp_rcv = kmalloc(SIZEOF_CMDRSP, GFP_ATOMIC);
if (!devdata->cmdrsp_rcv) { if (!devdata->cmdrsp_rcv) {
err = -ENOMEM; err = -ENOMEM;
goto cleanup_cmdrsp_rcv; goto cleanup_rcvbuf;
} }
devdata->xmit_cmdrsp = kmalloc(SIZEOF_CMDRSP, GFP_ATOMIC); devdata->xmit_cmdrsp = kmalloc(SIZEOF_CMDRSP, GFP_ATOMIC);
if (!devdata->xmit_cmdrsp) { if (!devdata->xmit_cmdrsp) {
err = -ENOMEM; err = -ENOMEM;
goto cleanup_xmit_cmdrsp; goto cleanup_cmdrsp_rcv;
} }
INIT_WORK(&devdata->timeout_reset, visornic_timeout_reset); INIT_WORK(&devdata->timeout_reset, visornic_timeout_reset);
devdata->server_down = false; devdata->server_down = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment