diff options
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: |