diff options
Diffstat (limited to 'net/irda/irlap.c')
-rw-r--r-- | net/irda/irlap.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/net/irda/irlap.c b/net/irda/irlap.c index cade355ac8af..e7852a07495e 100644 --- a/net/irda/irlap.c +++ b/net/irda/irlap.c | |||
@@ -116,11 +116,10 @@ struct irlap_cb *irlap_open(struct net_device *dev, struct qos_info *qos, | |||
116 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__); | 116 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__); |
117 | 117 | ||
118 | /* Initialize the irlap structure. */ | 118 | /* Initialize the irlap structure. */ |
119 | self = kmalloc(sizeof(struct irlap_cb), GFP_KERNEL); | 119 | self = kzalloc(sizeof(struct irlap_cb), GFP_KERNEL); |
120 | if (self == NULL) | 120 | if (self == NULL) |
121 | return NULL; | 121 | return NULL; |
122 | 122 | ||
123 | memset(self, 0, sizeof(struct irlap_cb)); | ||
124 | self->magic = LAP_MAGIC; | 123 | self->magic = LAP_MAGIC; |
125 | 124 | ||
126 | /* Make a binding between the layers */ | 125 | /* Make a binding between the layers */ |
@@ -882,7 +881,7 @@ static void irlap_change_speed(struct irlap_cb *self, __u32 speed, int now) | |||
882 | /* Change speed now, or just piggyback speed on frames */ | 881 | /* Change speed now, or just piggyback speed on frames */ |
883 | if (now) { | 882 | if (now) { |
884 | /* Send down empty frame to trigger speed change */ | 883 | /* Send down empty frame to trigger speed change */ |
885 | skb = dev_alloc_skb(0); | 884 | skb = alloc_skb(0, GFP_ATOMIC); |
886 | if (skb) | 885 | if (skb) |
887 | irlap_queue_xmit(self, skb); | 886 | irlap_queue_xmit(self, skb); |
888 | } | 887 | } |
@@ -1222,7 +1221,7 @@ static int irlap_seq_open(struct inode *inode, struct file *file) | |||
1222 | { | 1221 | { |
1223 | struct seq_file *seq; | 1222 | struct seq_file *seq; |
1224 | int rc = -ENOMEM; | 1223 | int rc = -ENOMEM; |
1225 | struct irlap_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); | 1224 | struct irlap_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL); |
1226 | 1225 | ||
1227 | if (!s) | 1226 | if (!s) |
1228 | goto out; | 1227 | goto out; |
@@ -1238,7 +1237,6 @@ static int irlap_seq_open(struct inode *inode, struct file *file) | |||
1238 | 1237 | ||
1239 | seq = file->private_data; | 1238 | seq = file->private_data; |
1240 | seq->private = s; | 1239 | seq->private = s; |
1241 | memset(s, 0, sizeof(*s)); | ||
1242 | out: | 1240 | out: |
1243 | return rc; | 1241 | return rc; |
1244 | out_kfree: | 1242 | out_kfree: |