aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipvs/ip_vs_ctl.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-07-21 19:44:45 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-21 19:44:45 -0400
commit12157a8d78af50842774bedb80b7b84a87f60951 (patch)
tree7e1c3ec5eb07b212cc6f6b4663ae6dff1ae78eb9 /net/ipv4/ipvs/ip_vs_ctl.c
parentefab4cbe99f9b73d208ad9e5ec9388524005e095 (diff)
parent9df3f3d28bca0157e2bab2f3171d2ad4f0930634 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (21 commits) [TIPC]: Removing useless casts [IPV4]: Fix nexthop realm dumping for multipath routes [DUMMY]: Avoid an oops when dummy_init_one() failed [IFB] After ifb_init_one() failed, i is increased. Decrease [NET]: Fix reversed error test in netif_tx_trylock [MAINTAINERS]: Mark LAPB as Oprhan. [NET]: Conversions from kmalloc+memset to k(z|c)alloc. [NET]: sun happymeal, little pci cleanup [IrDA]: Use alloc_skb() in IrDA TX path [I/OAT]: Remove pci_module_init() from Intel I/OAT DMA engine [I/OAT]: net/core/user_dma.c should #include <net/netdma.h> [SCTP]: ADDIP: Don't use an address as source until it is ASCONF-ACKed [SCTP]: Set chunk->data_accepted only if we are going to accept it. [SCTP]: Verify all the paths to a peer via heartbeat before using them. [SCTP]: Unhash the endpoint in sctp_endpoint_free(). [SCTP]: Check for NULL arg to sctp_bucket_destroy(). [PKT_SCHED] netem: Fix slab corruption with netem (2nd try) [WAN]: Converted synclink drivers to use netif_carrier_*() [WAN]: Cosmetic changes to N2 and C101 drivers [WAN]: Added missing netif_dormant_off() to generic HDLC ...
Diffstat (limited to 'net/ipv4/ipvs/ip_vs_ctl.c')
-rw-r--r--net/ipv4/ipvs/ip_vs_ctl.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index f28ec6882162..6a28fafe910c 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -735,12 +735,11 @@ ip_vs_new_dest(struct ip_vs_service *svc, struct ip_vs_dest_user *udest,
735 if (atype != RTN_LOCAL && atype != RTN_UNICAST) 735 if (atype != RTN_LOCAL && atype != RTN_UNICAST)
736 return -EINVAL; 736 return -EINVAL;
737 737
738 dest = kmalloc(sizeof(struct ip_vs_dest), GFP_ATOMIC); 738 dest = kzalloc(sizeof(struct ip_vs_dest), GFP_ATOMIC);
739 if (dest == NULL) { 739 if (dest == NULL) {
740 IP_VS_ERR("ip_vs_new_dest: kmalloc failed.\n"); 740 IP_VS_ERR("ip_vs_new_dest: kmalloc failed.\n");
741 return -ENOMEM; 741 return -ENOMEM;
742 } 742 }
743 memset(dest, 0, sizeof(struct ip_vs_dest));
744 743
745 dest->protocol = svc->protocol; 744 dest->protocol = svc->protocol;
746 dest->vaddr = svc->addr; 745 dest->vaddr = svc->addr;
@@ -1050,14 +1049,12 @@ ip_vs_add_service(struct ip_vs_service_user *u, struct ip_vs_service **svc_p)
1050 goto out_mod_dec; 1049 goto out_mod_dec;
1051 } 1050 }
1052 1051
1053 svc = (struct ip_vs_service *) 1052 svc = kzalloc(sizeof(struct ip_vs_service), GFP_ATOMIC);
1054 kmalloc(sizeof(struct ip_vs_service), GFP_ATOMIC);
1055 if (svc == NULL) { 1053 if (svc == NULL) {
1056 IP_VS_DBG(1, "ip_vs_add_service: kmalloc failed.\n"); 1054 IP_VS_DBG(1, "ip_vs_add_service: kmalloc failed.\n");
1057 ret = -ENOMEM; 1055 ret = -ENOMEM;
1058 goto out_err; 1056 goto out_err;
1059 } 1057 }
1060 memset(svc, 0, sizeof(struct ip_vs_service));
1061 1058
1062 /* I'm the first user of the service */ 1059 /* I'm the first user of the service */
1063 atomic_set(&svc->usecnt, 1); 1060 atomic_set(&svc->usecnt, 1);
@@ -1797,7 +1794,7 @@ static int ip_vs_info_open(struct inode *inode, struct file *file)
1797{ 1794{
1798 struct seq_file *seq; 1795 struct seq_file *seq;
1799 int rc = -ENOMEM; 1796 int rc = -ENOMEM;
1800 struct ip_vs_iter *s = kmalloc(sizeof(*s), GFP_KERNEL); 1797 struct ip_vs_iter *s = kzalloc(sizeof(*s), GFP_KERNEL);
1801 1798
1802 if (!s) 1799 if (!s)
1803 goto out; 1800 goto out;
@@ -1808,7 +1805,6 @@ static int ip_vs_info_open(struct inode *inode, struct file *file)
1808 1805
1809 seq = file->private_data; 1806 seq = file->private_data;
1810 seq->private = s; 1807 seq->private = s;
1811 memset(s, 0, sizeof(*s));
1812out: 1808out:
1813 return rc; 1809 return rc;
1814out_kfree: 1810out_kfree: