mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
remove pointless NULL check before calling kfree
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
This commit is contained in:
1 parent
6fb79305d3
commit
911029bbef
11 files changed
+16
-33
No files matched your search
@@ -48,8 +48,7 @@ static int blkback_remove(struct xenbus_device *dev)
|
||||
unregister_xenbus_watch(&be->backend_watch);
|
||||
if (be->blkif)
|
||||
blkif_put(be->blkif);
|
||||
if (be->frontpath)
|
||||
kfree(be->frontpath);
|
||||
kfree(be->frontpath);
|
||||
kfree(be);
|
||||
return 0;
|
||||
}
|
||||
@@ -255,8 +254,7 @@ static int blkback_probe(struct xenbus_device *dev,
|
||||
free_be:
|
||||
if (be->backend_watch.node)
|
||||
unregister_xenbus_watch(&be->backend_watch);
|
||||
if (frontend)
|
||||
kfree(frontend);
|
||||
kfree(frontend);
|
||||
kfree(be);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -608,8 +608,7 @@ static int talk_to_backend(struct xenbus_device *dev,
|
||||
}
|
||||
|
||||
out:
|
||||
if (backend)
|
||||
kfree(backend);
|
||||
kfree(backend);
|
||||
return err;
|
||||
|
||||
abort_transaction:
|
||||
|
||||
@@ -52,8 +52,7 @@ static int blkback_remove(struct xenbus_device *dev)
|
||||
unregister_xenbus_watch(&be->backend_watch);
|
||||
if (be->blkif)
|
||||
blkif_put(be->blkif);
|
||||
if (be->frontpath)
|
||||
kfree(be->frontpath);
|
||||
kfree(be->frontpath);
|
||||
kfree(be);
|
||||
return 0;
|
||||
}
|
||||
@@ -200,8 +199,7 @@ static int blkback_probe(struct xenbus_device *dev,
|
||||
free_be:
|
||||
if (be->backend_watch.node)
|
||||
unregister_xenbus_watch(&be->backend_watch);
|
||||
if (frontend)
|
||||
kfree(frontend);
|
||||
kfree(frontend);
|
||||
kfree(be);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -160,10 +160,8 @@ static int __init make_loopback(int i)
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
if (dev1 != NULL)
|
||||
kfree(dev1);
|
||||
if (dev2 != NULL)
|
||||
kfree(dev2);
|
||||
kfree(dev1);
|
||||
kfree(dev2);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,8 +50,7 @@ static int netback_remove(struct xenbus_device *dev)
|
||||
unregister_xenbus_watch(&be->backend_watch);
|
||||
if (be->netif)
|
||||
netif_disconnect(be->netif);
|
||||
if (be->frontpath)
|
||||
kfree(be->frontpath);
|
||||
kfree(be->frontpath);
|
||||
kfree(be);
|
||||
return 0;
|
||||
}
|
||||
@@ -270,8 +269,7 @@ static int netback_probe(struct xenbus_device *dev,
|
||||
free_be:
|
||||
if (be->backend_watch.node)
|
||||
unregister_xenbus_watch(&be->backend_watch);
|
||||
if (frontend)
|
||||
kfree(frontend);
|
||||
kfree(frontend);
|
||||
kfree(be);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -1232,8 +1232,7 @@ static int talk_to_backend(struct xenbus_device *dev,
|
||||
netif_state = NETIF_STATE_CONNECTED;
|
||||
|
||||
out:
|
||||
if (backend)
|
||||
kfree(backend);
|
||||
kfree(backend);
|
||||
return err;
|
||||
|
||||
abort_transaction:
|
||||
|
||||
@@ -148,9 +148,7 @@ static void inline
|
||||
packet_free(struct packet *pak)
|
||||
{
|
||||
del_singleshot_timer_sync(&pak->processing_timer);
|
||||
if (pak->data_buffer) {
|
||||
kfree(pak->data_buffer);
|
||||
}
|
||||
kfree(pak->data_buffer);
|
||||
/*
|
||||
* cannot do tpmif_put(pak->tpmif); bad things happen
|
||||
* on the last tpmif_put()
|
||||
|
||||
@@ -52,8 +52,7 @@ static int tpmback_remove(struct xenbus_device *dev)
|
||||
tpmif_put(be->tpmif);
|
||||
}
|
||||
|
||||
if (be->frontpath)
|
||||
kfree(be->frontpath);
|
||||
kfree(be->frontpath);
|
||||
kfree(be);
|
||||
return 0;
|
||||
}
|
||||
@@ -243,8 +242,7 @@ static int tpmback_probe(struct xenbus_device *dev,
|
||||
free_be:
|
||||
if (be->backend_watch.node)
|
||||
unregister_xenbus_watch(&be->backend_watch);
|
||||
if (frontend)
|
||||
kfree(frontend);
|
||||
kfree(frontend);
|
||||
kfree(be);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -363,8 +363,7 @@ static int talk_to_backend(struct xenbus_device *dev,
|
||||
}
|
||||
|
||||
out:
|
||||
if (backend)
|
||||
kfree(backend);
|
||||
kfree(backend);
|
||||
return err;
|
||||
|
||||
abort_transaction:
|
||||
|
||||
@@ -781,8 +781,7 @@ static void dispatch_usb_io(usbif_priv_t *up, usbif_request_t *req)
|
||||
return;
|
||||
|
||||
no_mem:
|
||||
if ( setup != NULL )
|
||||
kfree(setup);
|
||||
kfree(setup);
|
||||
make_response(up, req->id, req->operation, -ENOMEM, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1720,8 +1720,7 @@ static int __init xhci_hcd_init(void)
|
||||
return 0;
|
||||
|
||||
up_failed:
|
||||
if (errbuf)
|
||||
kfree(errbuf);
|
||||
kfree(errbuf);
|
||||
|
||||
errbuf_failed:
|
||||
return retval;
|
||||
|
||||