debuggers.hg
changeset 6760:ac6605bceb9d
remove pointless NULL check before calling kfree
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
line diff
1.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Sat Sep 10 14:38:01 2005 +0000 1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Sat Sep 10 14:41:16 2005 +0000 1.3 @@ -48,8 +48,7 @@ static int blkback_remove(struct xenbus_ 1.4 unregister_xenbus_watch(&be->backend_watch); 1.5 if (be->blkif) 1.6 blkif_put(be->blkif); 1.7 - if (be->frontpath) 1.8 - kfree(be->frontpath); 1.9 + kfree(be->frontpath); 1.10 kfree(be); 1.11 return 0; 1.12 } 1.13 @@ -255,8 +254,7 @@ static int blkback_probe(struct xenbus_d 1.14 free_be: 1.15 if (be->backend_watch.node) 1.16 unregister_xenbus_watch(&be->backend_watch); 1.17 - if (frontend) 1.18 - kfree(frontend); 1.19 + kfree(frontend); 1.20 kfree(be); 1.21 return err; 1.22 }
2.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c Sat Sep 10 14:38:01 2005 +0000 2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c Sat Sep 10 14:41:16 2005 +0000 2.3 @@ -608,8 +608,7 @@ static int talk_to_backend(struct xenbus 2.4 } 2.5 2.6 out: 2.7 - if (backend) 2.8 - kfree(backend); 2.9 + kfree(backend); 2.10 return err; 2.11 2.12 abort_transaction:
3.1 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c Sat Sep 10 14:38:01 2005 +0000 3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c Sat Sep 10 14:41:16 2005 +0000 3.3 @@ -52,8 +52,7 @@ static int blkback_remove(struct xenbus_ 3.4 unregister_xenbus_watch(&be->backend_watch); 3.5 if (be->blkif) 3.6 blkif_put(be->blkif); 3.7 - if (be->frontpath) 3.8 - kfree(be->frontpath); 3.9 + kfree(be->frontpath); 3.10 kfree(be); 3.11 return 0; 3.12 } 3.13 @@ -200,8 +199,7 @@ static int blkback_probe(struct xenbus_d 3.14 free_be: 3.15 if (be->backend_watch.node) 3.16 unregister_xenbus_watch(&be->backend_watch); 3.17 - if (frontend) 3.18 - kfree(frontend); 3.19 + kfree(frontend); 3.20 kfree(be); 3.21 return err; 3.22 }
4.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/loopback.c Sat Sep 10 14:38:01 2005 +0000 4.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/loopback.c Sat Sep 10 14:41:16 2005 +0000 4.3 @@ -160,10 +160,8 @@ static int __init make_loopback(int i) 4.4 return 0; 4.5 4.6 fail: 4.7 - if (dev1 != NULL) 4.8 - kfree(dev1); 4.9 - if (dev2 != NULL) 4.10 - kfree(dev2); 4.11 + kfree(dev1); 4.12 + kfree(dev2); 4.13 return err; 4.14 } 4.15
5.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c Sat Sep 10 14:38:01 2005 +0000 5.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c Sat Sep 10 14:41:16 2005 +0000 5.3 @@ -50,8 +50,7 @@ static int netback_remove(struct xenbus_ 5.4 unregister_xenbus_watch(&be->backend_watch); 5.5 if (be->netif) 5.6 netif_disconnect(be->netif); 5.7 - if (be->frontpath) 5.8 - kfree(be->frontpath); 5.9 + kfree(be->frontpath); 5.10 kfree(be); 5.11 return 0; 5.12 } 5.13 @@ -270,8 +269,7 @@ static int netback_probe(struct xenbus_d 5.14 free_be: 5.15 if (be->backend_watch.node) 5.16 unregister_xenbus_watch(&be->backend_watch); 5.17 - if (frontend) 5.18 - kfree(frontend); 5.19 + kfree(frontend); 5.20 kfree(be); 5.21 return err; 5.22 }
6.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Sat Sep 10 14:38:01 2005 +0000 6.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Sat Sep 10 14:41:16 2005 +0000 6.3 @@ -1232,8 +1232,7 @@ static int talk_to_backend(struct xenbus 6.4 netif_state = NETIF_STATE_CONNECTED; 6.5 6.6 out: 6.7 - if (backend) 6.8 - kfree(backend); 6.9 + kfree(backend); 6.10 return err; 6.11 6.12 abort_transaction:
7.1 --- a/linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c Sat Sep 10 14:38:01 2005 +0000 7.2 +++ b/linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c Sat Sep 10 14:41:16 2005 +0000 7.3 @@ -148,9 +148,7 @@ static void inline 7.4 packet_free(struct packet *pak) 7.5 { 7.6 del_singleshot_timer_sync(&pak->processing_timer); 7.7 - if (pak->data_buffer) { 7.8 - kfree(pak->data_buffer); 7.9 - } 7.10 + kfree(pak->data_buffer); 7.11 /* 7.12 * cannot do tpmif_put(pak->tpmif); bad things happen 7.13 * on the last tpmif_put()
8.1 --- a/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c Sat Sep 10 14:38:01 2005 +0000 8.2 +++ b/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c Sat Sep 10 14:41:16 2005 +0000 8.3 @@ -52,8 +52,7 @@ static int tpmback_remove(struct xenbus_ 8.4 tpmif_put(be->tpmif); 8.5 } 8.6 8.7 - if (be->frontpath) 8.8 - kfree(be->frontpath); 8.9 + kfree(be->frontpath); 8.10 kfree(be); 8.11 return 0; 8.12 } 8.13 @@ -243,8 +242,7 @@ static int tpmback_probe(struct xenbus_d 8.14 free_be: 8.15 if (be->backend_watch.node) 8.16 unregister_xenbus_watch(&be->backend_watch); 8.17 - if (frontend) 8.18 - kfree(frontend); 8.19 + kfree(frontend); 8.20 kfree(be); 8.21 return err; 8.22 }
9.1 --- a/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c Sat Sep 10 14:38:01 2005 +0000 9.2 +++ b/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c Sat Sep 10 14:41:16 2005 +0000 9.3 @@ -363,8 +363,7 @@ static int talk_to_backend(struct xenbus 9.4 } 9.5 9.6 out: 9.7 - if (backend) 9.8 - kfree(backend); 9.9 + kfree(backend); 9.10 return err; 9.11 9.12 abort_transaction:
10.1 --- a/linux-2.6-xen-sparse/drivers/xen/usbback/usbback.c Sat Sep 10 14:38:01 2005 +0000 10.2 +++ b/linux-2.6-xen-sparse/drivers/xen/usbback/usbback.c Sat Sep 10 14:41:16 2005 +0000 10.3 @@ -781,8 +781,7 @@ static void dispatch_usb_io(usbif_priv_t 10.4 return; 10.5 10.6 no_mem: 10.7 - if ( setup != NULL ) 10.8 - kfree(setup); 10.9 + kfree(setup); 10.10 make_response(up, req->id, req->operation, -ENOMEM, 0, 0); 10.11 return; 10.12 }
11.1 --- a/linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront.c Sat Sep 10 14:38:01 2005 +0000 11.2 +++ b/linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront.c Sat Sep 10 14:41:16 2005 +0000 11.3 @@ -1720,8 +1720,7 @@ static int __init xhci_hcd_init(void) 11.4 return 0; 11.5 11.6 up_failed: 11.7 - if (errbuf) 11.8 - kfree(errbuf); 11.9 + kfree(errbuf); 11.10 11.11 errbuf_failed: 11.12 return retval;