aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/ircomm
diff options
context:
space:
mode:
authorPanagiotis Issaris <takis@issaris.org>2006-07-21 17:51:30 -0400
committerDavid S. Miller <davem@davemloft.net>2006-07-21 17:51:30 -0400
commit0da974f4f303a6842516b764507e3c0a03f41e5a (patch)
tree8872aec792f02040269c6769dd1009b20f71d186 /net/irda/ircomm
parenta0ee7c70b22f78593957f99faa06acb4747b8bc0 (diff)
[NET]: Conversions from kmalloc+memset to k(z|c)alloc.
Signed-off-by: Panagiotis Issaris <takis@issaris.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/irda/ircomm')
-rw-r--r--net/irda/ircomm/ircomm_core.c4
-rw-r--r--net/irda/ircomm/ircomm_tty.c3
2 files changed, 2 insertions, 5 deletions
diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c
index 9c4a902a9dba..ad6b6af3dd97 100644
--- a/net/irda/ircomm/ircomm_core.c
+++ b/net/irda/ircomm/ircomm_core.c
@@ -115,12 +115,10 @@ struct ircomm_cb *ircomm_open(notify_t *notify, __u8 service_type, int line)
115 115
116 IRDA_ASSERT(ircomm != NULL, return NULL;); 116 IRDA_ASSERT(ircomm != NULL, return NULL;);
117 117
118 self = kmalloc(sizeof(struct ircomm_cb), GFP_ATOMIC); 118 self = kzalloc(sizeof(struct ircomm_cb), GFP_ATOMIC);
119 if (self == NULL) 119 if (self == NULL)
120 return NULL; 120 return NULL;
121 121
122 memset(self, 0, sizeof(struct ircomm_cb));
123
124 self->notify = *notify; 122 self->notify = *notify;
125 self->magic = IRCOMM_MAGIC; 123 self->magic = IRCOMM_MAGIC;
126 124
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
index cde3b84d4a0e..3bcdb467efc5 100644
--- a/net/irda/ircomm/ircomm_tty.c
+++ b/net/irda/ircomm/ircomm_tty.c
@@ -379,12 +379,11 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
379 self = hashbin_lock_find(ircomm_tty, line, NULL); 379 self = hashbin_lock_find(ircomm_tty, line, NULL);
380 if (!self) { 380 if (!self) {
381 /* No, so make new instance */ 381 /* No, so make new instance */
382 self = kmalloc(sizeof(struct ircomm_tty_cb), GFP_KERNEL); 382 self = kzalloc(sizeof(struct ircomm_tty_cb), GFP_KERNEL);
383 if (self == NULL) { 383 if (self == NULL) {
384 IRDA_ERROR("%s(), kmalloc failed!\n", __FUNCTION__); 384 IRDA_ERROR("%s(), kmalloc failed!\n", __FUNCTION__);
385 return -ENOMEM; 385 return -ENOMEM;
386 } 386 }
387 memset(self, 0, sizeof(struct ircomm_tty_cb));
388 387
389 self->magic = IRCOMM_TTY_MAGIC; 388 self->magic = IRCOMM_TTY_MAGIC;
390 self->flow = FLOW_STOP; 389 self->flow = FLOW_STOP;