diff options
author | Panagiotis Issaris <takis@issaris.org> | 2006-07-21 17:51:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-07-21 17:51:30 -0400 |
commit | 0da974f4f303a6842516b764507e3c0a03f41e5a (patch) | |
tree | 8872aec792f02040269c6769dd1009b20f71d186 /net/irda/irttp.c | |
parent | a0ee7c70b22f78593957f99faa06acb4747b8bc0 (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/irttp.c')
-rw-r--r-- | net/irda/irttp.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/irda/irttp.c b/net/irda/irttp.c index 7a3ccb8a6698..42acf1cde737 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c | |||
@@ -85,10 +85,9 @@ static pi_param_info_t param_info = { pi_major_call_table, 1, 0x0f, 4 }; | |||
85 | */ | 85 | */ |
86 | int __init irttp_init(void) | 86 | int __init irttp_init(void) |
87 | { | 87 | { |
88 | irttp = kmalloc(sizeof(struct irttp_cb), GFP_KERNEL); | 88 | irttp = kzalloc(sizeof(struct irttp_cb), GFP_KERNEL); |
89 | if (irttp == NULL) | 89 | if (irttp == NULL) |
90 | return -ENOMEM; | 90 | return -ENOMEM; |
91 | memset(irttp, 0, sizeof(struct irttp_cb)); | ||
92 | 91 | ||
93 | irttp->magic = TTP_MAGIC; | 92 | irttp->magic = TTP_MAGIC; |
94 | 93 | ||
@@ -390,12 +389,11 @@ struct tsap_cb *irttp_open_tsap(__u8 stsap_sel, int credit, notify_t *notify) | |||
390 | return NULL; | 389 | return NULL; |
391 | } | 390 | } |
392 | 391 | ||
393 | self = kmalloc(sizeof(struct tsap_cb), GFP_ATOMIC); | 392 | self = kzalloc(sizeof(struct tsap_cb), GFP_ATOMIC); |
394 | if (self == NULL) { | 393 | if (self == NULL) { |
395 | IRDA_DEBUG(0, "%s(), unable to kmalloc!\n", __FUNCTION__); | 394 | IRDA_DEBUG(0, "%s(), unable to kmalloc!\n", __FUNCTION__); |
396 | return NULL; | 395 | return NULL; |
397 | } | 396 | } |
398 | memset(self, 0, sizeof(struct tsap_cb)); | ||
399 | spin_lock_init(&self->lock); | 397 | spin_lock_init(&self->lock); |
400 | 398 | ||
401 | /* Initialise todo timer */ | 399 | /* Initialise todo timer */ |
@@ -1877,7 +1875,7 @@ static int irttp_seq_open(struct inode *inode, struct file *file) | |||
1877 | int rc = -ENOMEM; | 1875 | int rc = -ENOMEM; |
1878 | struct irttp_iter_state *s; | 1876 | struct irttp_iter_state *s; |
1879 | 1877 | ||
1880 | s = kmalloc(sizeof(*s), GFP_KERNEL); | 1878 | s = kzalloc(sizeof(*s), GFP_KERNEL); |
1881 | if (!s) | 1879 | if (!s) |
1882 | goto out; | 1880 | goto out; |
1883 | 1881 | ||
@@ -1887,7 +1885,6 @@ static int irttp_seq_open(struct inode *inode, struct file *file) | |||
1887 | 1885 | ||
1888 | seq = file->private_data; | 1886 | seq = file->private_data; |
1889 | seq->private = s; | 1887 | seq->private = s; |
1890 | memset(s, 0, sizeof(*s)); | ||
1891 | out: | 1888 | out: |
1892 | return rc; | 1889 | return rc; |
1893 | out_kfree: | 1890 | out_kfree: |