diff options
Diffstat (limited to 'net/irda')
-rw-r--r-- | net/irda/af_irda.c | 2 | ||||
-rw-r--r-- | net/irda/ircomm/ircomm_core.c | 4 | ||||
-rw-r--r-- | net/irda/ircomm/ircomm_lmp.c | 4 | ||||
-rw-r--r-- | net/irda/ircomm/ircomm_param.c | 2 | ||||
-rw-r--r-- | net/irda/ircomm/ircomm_tty.c | 8 | ||||
-rw-r--r-- | net/irda/irda_device.c | 4 | ||||
-rw-r--r-- | net/irda/iriap.c | 9 | ||||
-rw-r--r-- | net/irda/iriap_event.c | 2 | ||||
-rw-r--r-- | net/irda/irias_object.c | 24 | ||||
-rw-r--r-- | net/irda/irlan/irlan_common.c | 16 | ||||
-rw-r--r-- | net/irda/irlan/irlan_provider.c | 2 | ||||
-rw-r--r-- | net/irda/irlap.c | 8 | ||||
-rw-r--r-- | net/irda/irlap_frame.c | 19 | ||||
-rw-r--r-- | net/irda/irlmp.c | 11 | ||||
-rw-r--r-- | net/irda/irnet/irnet_ppp.c | 3 | ||||
-rw-r--r-- | net/irda/irttp.c | 20 |
16 files changed, 59 insertions, 79 deletions
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 7fae48a53bff..17699eeb64d7 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c | |||
@@ -308,7 +308,7 @@ static void irda_connect_response(struct irda_sock *self) | |||
308 | 308 | ||
309 | IRDA_ASSERT(self != NULL, return;); | 309 | IRDA_ASSERT(self != NULL, return;); |
310 | 310 | ||
311 | skb = dev_alloc_skb(64); | 311 | skb = alloc_skb(64, GFP_ATOMIC); |
312 | if (skb == NULL) { | 312 | if (skb == NULL) { |
313 | IRDA_DEBUG(0, "%s() Unable to allocate sk_buff!\n", | 313 | IRDA_DEBUG(0, "%s() Unable to allocate sk_buff!\n", |
314 | __FUNCTION__); | 314 | __FUNCTION__); |
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_lmp.c b/net/irda/ircomm/ircomm_lmp.c index d9097207aed3..959874b6451f 100644 --- a/net/irda/ircomm/ircomm_lmp.c +++ b/net/irda/ircomm/ircomm_lmp.c | |||
@@ -81,7 +81,7 @@ static int ircomm_lmp_connect_response(struct ircomm_cb *self, | |||
81 | 81 | ||
82 | /* Any userdata supplied? */ | 82 | /* Any userdata supplied? */ |
83 | if (userdata == NULL) { | 83 | if (userdata == NULL) { |
84 | tx_skb = dev_alloc_skb(64); | 84 | tx_skb = alloc_skb(64, GFP_ATOMIC); |
85 | if (!tx_skb) | 85 | if (!tx_skb) |
86 | return -ENOMEM; | 86 | return -ENOMEM; |
87 | 87 | ||
@@ -115,7 +115,7 @@ static int ircomm_lmp_disconnect_request(struct ircomm_cb *self, | |||
115 | IRDA_DEBUG(0, "%s()\n", __FUNCTION__ ); | 115 | IRDA_DEBUG(0, "%s()\n", __FUNCTION__ ); |
116 | 116 | ||
117 | if (!userdata) { | 117 | if (!userdata) { |
118 | tx_skb = dev_alloc_skb(64); | 118 | tx_skb = alloc_skb(64, GFP_ATOMIC); |
119 | if (!tx_skb) | 119 | if (!tx_skb) |
120 | return -ENOMEM; | 120 | return -ENOMEM; |
121 | 121 | ||
diff --git a/net/irda/ircomm/ircomm_param.c b/net/irda/ircomm/ircomm_param.c index 6009bab05091..a39f5735a90b 100644 --- a/net/irda/ircomm/ircomm_param.c +++ b/net/irda/ircomm/ircomm_param.c | |||
@@ -121,7 +121,7 @@ int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush) | |||
121 | 121 | ||
122 | skb = self->ctrl_skb; | 122 | skb = self->ctrl_skb; |
123 | if (!skb) { | 123 | if (!skb) { |
124 | skb = dev_alloc_skb(256); | 124 | skb = alloc_skb(256, GFP_ATOMIC); |
125 | if (!skb) { | 125 | if (!skb) { |
126 | spin_unlock_irqrestore(&self->spinlock, flags); | 126 | spin_unlock_irqrestore(&self->spinlock, flags); |
127 | return -ENOMEM; | 127 | return -ENOMEM; |
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c index b400f27851fc..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; |
@@ -759,8 +758,9 @@ static int ircomm_tty_write(struct tty_struct *tty, | |||
759 | } | 758 | } |
760 | } else { | 759 | } else { |
761 | /* Prepare a full sized frame */ | 760 | /* Prepare a full sized frame */ |
762 | skb = dev_alloc_skb(self->max_data_size+ | 761 | skb = alloc_skb(self->max_data_size+ |
763 | self->max_header_size); | 762 | self->max_header_size, |
763 | GFP_ATOMIC); | ||
764 | if (!skb) { | 764 | if (!skb) { |
765 | spin_unlock_irqrestore(&self->spinlock, flags); | 765 | spin_unlock_irqrestore(&self->spinlock, flags); |
766 | return -ENOBUFS; | 766 | return -ENOBUFS; |
diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c index ba40e5495f58..7e7a31798d8d 100644 --- a/net/irda/irda_device.c +++ b/net/irda/irda_device.c | |||
@@ -401,12 +401,10 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type) | |||
401 | } | 401 | } |
402 | 402 | ||
403 | /* Allocate dongle info for this instance */ | 403 | /* Allocate dongle info for this instance */ |
404 | dongle = kmalloc(sizeof(dongle_t), GFP_KERNEL); | 404 | dongle = kzalloc(sizeof(dongle_t), GFP_KERNEL); |
405 | if (!dongle) | 405 | if (!dongle) |
406 | goto out; | 406 | goto out; |
407 | 407 | ||
408 | memset(dongle, 0, sizeof(dongle_t)); | ||
409 | |||
410 | /* Bind the registration info to this particular instance */ | 408 | /* Bind the registration info to this particular instance */ |
411 | dongle->issue = reg; | 409 | dongle->issue = reg; |
412 | dongle->dev = dev; | 410 | dongle->dev = dev; |
diff --git a/net/irda/iriap.c b/net/irda/iriap.c index a0472652a44e..61128aa05b40 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c | |||
@@ -345,7 +345,7 @@ static void iriap_disconnect_request(struct iriap_cb *self) | |||
345 | IRDA_ASSERT(self != NULL, return;); | 345 | IRDA_ASSERT(self != NULL, return;); |
346 | IRDA_ASSERT(self->magic == IAS_MAGIC, return;); | 346 | IRDA_ASSERT(self->magic == IAS_MAGIC, return;); |
347 | 347 | ||
348 | tx_skb = dev_alloc_skb(64); | 348 | tx_skb = alloc_skb(64, GFP_ATOMIC); |
349 | if (tx_skb == NULL) { | 349 | if (tx_skb == NULL) { |
350 | IRDA_DEBUG(0, "%s(), Could not allocate an sk_buff of length %d\n", | 350 | IRDA_DEBUG(0, "%s(), Could not allocate an sk_buff of length %d\n", |
351 | __FUNCTION__, 64); | 351 | __FUNCTION__, 64); |
@@ -396,7 +396,7 @@ int iriap_getvaluebyclass_request(struct iriap_cb *self, | |||
396 | attr_len = strlen(attr); /* Up to IAS_MAX_ATTRIBNAME = 60 */ | 396 | attr_len = strlen(attr); /* Up to IAS_MAX_ATTRIBNAME = 60 */ |
397 | 397 | ||
398 | skb_len = self->max_header_size+2+name_len+1+attr_len+4; | 398 | skb_len = self->max_header_size+2+name_len+1+attr_len+4; |
399 | tx_skb = dev_alloc_skb(skb_len); | 399 | tx_skb = alloc_skb(skb_len, GFP_ATOMIC); |
400 | if (!tx_skb) | 400 | if (!tx_skb) |
401 | return -ENOMEM; | 401 | return -ENOMEM; |
402 | 402 | ||
@@ -562,7 +562,8 @@ static void iriap_getvaluebyclass_response(struct iriap_cb *self, | |||
562 | * value. We add 32 bytes because of the 6 bytes for the frame and | 562 | * value. We add 32 bytes because of the 6 bytes for the frame and |
563 | * max 5 bytes for the value coding. | 563 | * max 5 bytes for the value coding. |
564 | */ | 564 | */ |
565 | tx_skb = dev_alloc_skb(value->len + self->max_header_size + 32); | 565 | tx_skb = alloc_skb(value->len + self->max_header_size + 32, |
566 | GFP_ATOMIC); | ||
566 | if (!tx_skb) | 567 | if (!tx_skb) |
567 | return; | 568 | return; |
568 | 569 | ||
@@ -700,7 +701,7 @@ void iriap_send_ack(struct iriap_cb *self) | |||
700 | IRDA_ASSERT(self != NULL, return;); | 701 | IRDA_ASSERT(self != NULL, return;); |
701 | IRDA_ASSERT(self->magic == IAS_MAGIC, return;); | 702 | IRDA_ASSERT(self->magic == IAS_MAGIC, return;); |
702 | 703 | ||
703 | tx_skb = dev_alloc_skb(64); | 704 | tx_skb = alloc_skb(64, GFP_ATOMIC); |
704 | if (!tx_skb) | 705 | if (!tx_skb) |
705 | return; | 706 | return; |
706 | 707 | ||
diff --git a/net/irda/iriap_event.c b/net/irda/iriap_event.c index a73607450de1..da17395df05a 100644 --- a/net/irda/iriap_event.c +++ b/net/irda/iriap_event.c | |||
@@ -365,7 +365,7 @@ static void state_r_disconnect(struct iriap_cb *self, IRIAP_EVENT event, | |||
365 | 365 | ||
366 | switch (event) { | 366 | switch (event) { |
367 | case IAP_LM_CONNECT_INDICATION: | 367 | case IAP_LM_CONNECT_INDICATION: |
368 | tx_skb = dev_alloc_skb(64); | 368 | tx_skb = alloc_skb(64, GFP_ATOMIC); |
369 | if (tx_skb == NULL) { | 369 | if (tx_skb == NULL) { |
370 | IRDA_WARNING("%s: unable to malloc!\n", __FUNCTION__); | 370 | IRDA_WARNING("%s: unable to malloc!\n", __FUNCTION__); |
371 | return; | 371 | return; |
diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c index 82e665c79991..a154b1d71c0f 100644 --- a/net/irda/irias_object.c +++ b/net/irda/irias_object.c | |||
@@ -82,13 +82,12 @@ struct ias_object *irias_new_object( char *name, int id) | |||
82 | 82 | ||
83 | IRDA_DEBUG( 4, "%s()\n", __FUNCTION__); | 83 | IRDA_DEBUG( 4, "%s()\n", __FUNCTION__); |
84 | 84 | ||
85 | obj = kmalloc(sizeof(struct ias_object), GFP_ATOMIC); | 85 | obj = kzalloc(sizeof(struct ias_object), GFP_ATOMIC); |
86 | if (obj == NULL) { | 86 | if (obj == NULL) { |
87 | IRDA_WARNING("%s(), Unable to allocate object!\n", | 87 | IRDA_WARNING("%s(), Unable to allocate object!\n", |
88 | __FUNCTION__); | 88 | __FUNCTION__); |
89 | return NULL; | 89 | return NULL; |
90 | } | 90 | } |
91 | memset(obj, 0, sizeof( struct ias_object)); | ||
92 | 91 | ||
93 | obj->magic = IAS_OBJECT_MAGIC; | 92 | obj->magic = IAS_OBJECT_MAGIC; |
94 | obj->name = strndup(name, IAS_MAX_CLASSNAME); | 93 | obj->name = strndup(name, IAS_MAX_CLASSNAME); |
@@ -346,13 +345,12 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value, | |||
346 | IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;); | 345 | IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;); |
347 | IRDA_ASSERT(name != NULL, return;); | 346 | IRDA_ASSERT(name != NULL, return;); |
348 | 347 | ||
349 | attrib = kmalloc(sizeof(struct ias_attrib), GFP_ATOMIC); | 348 | attrib = kzalloc(sizeof(struct ias_attrib), GFP_ATOMIC); |
350 | if (attrib == NULL) { | 349 | if (attrib == NULL) { |
351 | IRDA_WARNING("%s: Unable to allocate attribute!\n", | 350 | IRDA_WARNING("%s: Unable to allocate attribute!\n", |
352 | __FUNCTION__); | 351 | __FUNCTION__); |
353 | return; | 352 | return; |
354 | } | 353 | } |
355 | memset(attrib, 0, sizeof( struct ias_attrib)); | ||
356 | 354 | ||
357 | attrib->magic = IAS_ATTRIB_MAGIC; | 355 | attrib->magic = IAS_ATTRIB_MAGIC; |
358 | attrib->name = strndup(name, IAS_MAX_ATTRIBNAME); | 356 | attrib->name = strndup(name, IAS_MAX_ATTRIBNAME); |
@@ -382,13 +380,12 @@ void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets, | |||
382 | IRDA_ASSERT(name != NULL, return;); | 380 | IRDA_ASSERT(name != NULL, return;); |
383 | IRDA_ASSERT(octets != NULL, return;); | 381 | IRDA_ASSERT(octets != NULL, return;); |
384 | 382 | ||
385 | attrib = kmalloc(sizeof(struct ias_attrib), GFP_ATOMIC); | 383 | attrib = kzalloc(sizeof(struct ias_attrib), GFP_ATOMIC); |
386 | if (attrib == NULL) { | 384 | if (attrib == NULL) { |
387 | IRDA_WARNING("%s: Unable to allocate attribute!\n", | 385 | IRDA_WARNING("%s: Unable to allocate attribute!\n", |
388 | __FUNCTION__); | 386 | __FUNCTION__); |
389 | return; | 387 | return; |
390 | } | 388 | } |
391 | memset(attrib, 0, sizeof( struct ias_attrib)); | ||
392 | 389 | ||
393 | attrib->magic = IAS_ATTRIB_MAGIC; | 390 | attrib->magic = IAS_ATTRIB_MAGIC; |
394 | attrib->name = strndup(name, IAS_MAX_ATTRIBNAME); | 391 | attrib->name = strndup(name, IAS_MAX_ATTRIBNAME); |
@@ -416,13 +413,12 @@ void irias_add_string_attrib(struct ias_object *obj, char *name, char *value, | |||
416 | IRDA_ASSERT(name != NULL, return;); | 413 | IRDA_ASSERT(name != NULL, return;); |
417 | IRDA_ASSERT(value != NULL, return;); | 414 | IRDA_ASSERT(value != NULL, return;); |
418 | 415 | ||
419 | attrib = kmalloc(sizeof( struct ias_attrib), GFP_ATOMIC); | 416 | attrib = kzalloc(sizeof( struct ias_attrib), GFP_ATOMIC); |
420 | if (attrib == NULL) { | 417 | if (attrib == NULL) { |
421 | IRDA_WARNING("%s: Unable to allocate attribute!\n", | 418 | IRDA_WARNING("%s: Unable to allocate attribute!\n", |
422 | __FUNCTION__); | 419 | __FUNCTION__); |
423 | return; | 420 | return; |
424 | } | 421 | } |
425 | memset(attrib, 0, sizeof( struct ias_attrib)); | ||
426 | 422 | ||
427 | attrib->magic = IAS_ATTRIB_MAGIC; | 423 | attrib->magic = IAS_ATTRIB_MAGIC; |
428 | attrib->name = strndup(name, IAS_MAX_ATTRIBNAME); | 424 | attrib->name = strndup(name, IAS_MAX_ATTRIBNAME); |
@@ -443,12 +439,11 @@ struct ias_value *irias_new_integer_value(int integer) | |||
443 | { | 439 | { |
444 | struct ias_value *value; | 440 | struct ias_value *value; |
445 | 441 | ||
446 | value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC); | 442 | value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC); |
447 | if (value == NULL) { | 443 | if (value == NULL) { |
448 | IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); | 444 | IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); |
449 | return NULL; | 445 | return NULL; |
450 | } | 446 | } |
451 | memset(value, 0, sizeof(struct ias_value)); | ||
452 | 447 | ||
453 | value->type = IAS_INTEGER; | 448 | value->type = IAS_INTEGER; |
454 | value->len = 4; | 449 | value->len = 4; |
@@ -469,12 +464,11 @@ struct ias_value *irias_new_string_value(char *string) | |||
469 | { | 464 | { |
470 | struct ias_value *value; | 465 | struct ias_value *value; |
471 | 466 | ||
472 | value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC); | 467 | value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC); |
473 | if (value == NULL) { | 468 | if (value == NULL) { |
474 | IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); | 469 | IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); |
475 | return NULL; | 470 | return NULL; |
476 | } | 471 | } |
477 | memset( value, 0, sizeof( struct ias_value)); | ||
478 | 472 | ||
479 | value->type = IAS_STRING; | 473 | value->type = IAS_STRING; |
480 | value->charset = CS_ASCII; | 474 | value->charset = CS_ASCII; |
@@ -495,12 +489,11 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len) | |||
495 | { | 489 | { |
496 | struct ias_value *value; | 490 | struct ias_value *value; |
497 | 491 | ||
498 | value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC); | 492 | value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC); |
499 | if (value == NULL) { | 493 | if (value == NULL) { |
500 | IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); | 494 | IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); |
501 | return NULL; | 495 | return NULL; |
502 | } | 496 | } |
503 | memset(value, 0, sizeof(struct ias_value)); | ||
504 | 497 | ||
505 | value->type = IAS_OCT_SEQ; | 498 | value->type = IAS_OCT_SEQ; |
506 | /* Check length */ | 499 | /* Check length */ |
@@ -522,12 +515,11 @@ struct ias_value *irias_new_missing_value(void) | |||
522 | { | 515 | { |
523 | struct ias_value *value; | 516 | struct ias_value *value; |
524 | 517 | ||
525 | value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC); | 518 | value = kzalloc(sizeof(struct ias_value), GFP_ATOMIC); |
526 | if (value == NULL) { | 519 | if (value == NULL) { |
527 | IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); | 520 | IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); |
528 | return NULL; | 521 | return NULL; |
529 | } | 522 | } |
530 | memset(value, 0, sizeof(struct ias_value)); | ||
531 | 523 | ||
532 | value->type = IAS_MISSING; | 524 | value->type = IAS_MISSING; |
533 | value->len = 0; | 525 | value->len = 0; |
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c index bd659dd545ac..7dd0a2fe1d20 100644 --- a/net/irda/irlan/irlan_common.c +++ b/net/irda/irlan/irlan_common.c | |||
@@ -636,7 +636,7 @@ void irlan_get_provider_info(struct irlan_cb *self) | |||
636 | IRDA_ASSERT(self != NULL, return;); | 636 | IRDA_ASSERT(self != NULL, return;); |
637 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 637 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
638 | 638 | ||
639 | skb = dev_alloc_skb(64); | 639 | skb = alloc_skb(64, GFP_ATOMIC); |
640 | if (!skb) | 640 | if (!skb) |
641 | return; | 641 | return; |
642 | 642 | ||
@@ -668,7 +668,7 @@ void irlan_open_data_channel(struct irlan_cb *self) | |||
668 | IRDA_ASSERT(self != NULL, return;); | 668 | IRDA_ASSERT(self != NULL, return;); |
669 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 669 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
670 | 670 | ||
671 | skb = dev_alloc_skb(64); | 671 | skb = alloc_skb(64, GFP_ATOMIC); |
672 | if (!skb) | 672 | if (!skb) |
673 | return; | 673 | return; |
674 | 674 | ||
@@ -704,7 +704,7 @@ void irlan_close_data_channel(struct irlan_cb *self) | |||
704 | if (self->client.tsap_ctrl == NULL) | 704 | if (self->client.tsap_ctrl == NULL) |
705 | return; | 705 | return; |
706 | 706 | ||
707 | skb = dev_alloc_skb(64); | 707 | skb = alloc_skb(64, GFP_ATOMIC); |
708 | if (!skb) | 708 | if (!skb) |
709 | return; | 709 | return; |
710 | 710 | ||
@@ -739,7 +739,7 @@ static void irlan_open_unicast_addr(struct irlan_cb *self) | |||
739 | IRDA_ASSERT(self != NULL, return;); | 739 | IRDA_ASSERT(self != NULL, return;); |
740 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 740 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
741 | 741 | ||
742 | skb = dev_alloc_skb(128); | 742 | skb = alloc_skb(128, GFP_ATOMIC); |
743 | if (!skb) | 743 | if (!skb) |
744 | return; | 744 | return; |
745 | 745 | ||
@@ -777,7 +777,7 @@ void irlan_set_broadcast_filter(struct irlan_cb *self, int status) | |||
777 | IRDA_ASSERT(self != NULL, return;); | 777 | IRDA_ASSERT(self != NULL, return;); |
778 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 778 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
779 | 779 | ||
780 | skb = dev_alloc_skb(128); | 780 | skb = alloc_skb(128, GFP_ATOMIC); |
781 | if (!skb) | 781 | if (!skb) |
782 | return; | 782 | return; |
783 | 783 | ||
@@ -816,7 +816,7 @@ void irlan_set_multicast_filter(struct irlan_cb *self, int status) | |||
816 | IRDA_ASSERT(self != NULL, return;); | 816 | IRDA_ASSERT(self != NULL, return;); |
817 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 817 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
818 | 818 | ||
819 | skb = dev_alloc_skb(128); | 819 | skb = alloc_skb(128, GFP_ATOMIC); |
820 | if (!skb) | 820 | if (!skb) |
821 | return; | 821 | return; |
822 | 822 | ||
@@ -856,7 +856,7 @@ static void irlan_get_unicast_addr(struct irlan_cb *self) | |||
856 | IRDA_ASSERT(self != NULL, return;); | 856 | IRDA_ASSERT(self != NULL, return;); |
857 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 857 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
858 | 858 | ||
859 | skb = dev_alloc_skb(128); | 859 | skb = alloc_skb(128, GFP_ATOMIC); |
860 | if (!skb) | 860 | if (!skb) |
861 | return; | 861 | return; |
862 | 862 | ||
@@ -891,7 +891,7 @@ void irlan_get_media_char(struct irlan_cb *self) | |||
891 | IRDA_ASSERT(self != NULL, return;); | 891 | IRDA_ASSERT(self != NULL, return;); |
892 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 892 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
893 | 893 | ||
894 | skb = dev_alloc_skb(64); | 894 | skb = alloc_skb(64, GFP_ATOMIC); |
895 | if (!skb) | 895 | if (!skb) |
896 | return; | 896 | return; |
897 | 897 | ||
diff --git a/net/irda/irlan/irlan_provider.c b/net/irda/irlan/irlan_provider.c index 39c202d1c374..9c0df86044d7 100644 --- a/net/irda/irlan/irlan_provider.c +++ b/net/irda/irlan/irlan_provider.c | |||
@@ -296,7 +296,7 @@ void irlan_provider_send_reply(struct irlan_cb *self, int command, | |||
296 | IRDA_ASSERT(self != NULL, return;); | 296 | IRDA_ASSERT(self != NULL, return;); |
297 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 297 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
298 | 298 | ||
299 | skb = dev_alloc_skb(128); | 299 | skb = alloc_skb(128, GFP_ATOMIC); |
300 | if (!skb) | 300 | if (!skb) |
301 | return; | 301 | return; |
302 | 302 | ||
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: |
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c index 3e9a06abbdd0..ccb983bf0f4a 100644 --- a/net/irda/irlap_frame.c +++ b/net/irda/irlap_frame.c | |||
@@ -117,7 +117,7 @@ void irlap_send_snrm_frame(struct irlap_cb *self, struct qos_info *qos) | |||
117 | IRDA_ASSERT(self->magic == LAP_MAGIC, return;); | 117 | IRDA_ASSERT(self->magic == LAP_MAGIC, return;); |
118 | 118 | ||
119 | /* Allocate frame */ | 119 | /* Allocate frame */ |
120 | tx_skb = dev_alloc_skb(64); | 120 | tx_skb = alloc_skb(64, GFP_ATOMIC); |
121 | if (!tx_skb) | 121 | if (!tx_skb) |
122 | return; | 122 | return; |
123 | 123 | ||
@@ -210,7 +210,7 @@ void irlap_send_ua_response_frame(struct irlap_cb *self, struct qos_info *qos) | |||
210 | IRDA_ASSERT(self->magic == LAP_MAGIC, return;); | 210 | IRDA_ASSERT(self->magic == LAP_MAGIC, return;); |
211 | 211 | ||
212 | /* Allocate frame */ | 212 | /* Allocate frame */ |
213 | tx_skb = dev_alloc_skb(64); | 213 | tx_skb = alloc_skb(64, GFP_ATOMIC); |
214 | if (!tx_skb) | 214 | if (!tx_skb) |
215 | return; | 215 | return; |
216 | 216 | ||
@@ -250,7 +250,7 @@ void irlap_send_dm_frame( struct irlap_cb *self) | |||
250 | IRDA_ASSERT(self != NULL, return;); | 250 | IRDA_ASSERT(self != NULL, return;); |
251 | IRDA_ASSERT(self->magic == LAP_MAGIC, return;); | 251 | IRDA_ASSERT(self->magic == LAP_MAGIC, return;); |
252 | 252 | ||
253 | tx_skb = dev_alloc_skb(32); | 253 | tx_skb = alloc_skb(32, GFP_ATOMIC); |
254 | if (!tx_skb) | 254 | if (!tx_skb) |
255 | return; | 255 | return; |
256 | 256 | ||
@@ -282,7 +282,7 @@ void irlap_send_disc_frame(struct irlap_cb *self) | |||
282 | IRDA_ASSERT(self != NULL, return;); | 282 | IRDA_ASSERT(self != NULL, return;); |
283 | IRDA_ASSERT(self->magic == LAP_MAGIC, return;); | 283 | IRDA_ASSERT(self->magic == LAP_MAGIC, return;); |
284 | 284 | ||
285 | tx_skb = dev_alloc_skb(16); | 285 | tx_skb = alloc_skb(16, GFP_ATOMIC); |
286 | if (!tx_skb) | 286 | if (!tx_skb) |
287 | return; | 287 | return; |
288 | 288 | ||
@@ -315,7 +315,7 @@ void irlap_send_discovery_xid_frame(struct irlap_cb *self, int S, __u8 s, | |||
315 | IRDA_ASSERT(self->magic == LAP_MAGIC, return;); | 315 | IRDA_ASSERT(self->magic == LAP_MAGIC, return;); |
316 | IRDA_ASSERT(discovery != NULL, return;); | 316 | IRDA_ASSERT(discovery != NULL, return;); |
317 | 317 | ||
318 | tx_skb = dev_alloc_skb(64); | 318 | tx_skb = alloc_skb(64, GFP_ATOMIC); |
319 | if (!tx_skb) | 319 | if (!tx_skb) |
320 | return; | 320 | return; |
321 | 321 | ||
@@ -422,11 +422,10 @@ static void irlap_recv_discovery_xid_rsp(struct irlap_cb *self, | |||
422 | return; | 422 | return; |
423 | } | 423 | } |
424 | 424 | ||
425 | if ((discovery = kmalloc(sizeof(discovery_t), GFP_ATOMIC)) == NULL) { | 425 | if ((discovery = kzalloc(sizeof(discovery_t), GFP_ATOMIC)) == NULL) { |
426 | IRDA_WARNING("%s: kmalloc failed!\n", __FUNCTION__); | 426 | IRDA_WARNING("%s: kmalloc failed!\n", __FUNCTION__); |
427 | return; | 427 | return; |
428 | } | 428 | } |
429 | memset(discovery, 0, sizeof(discovery_t)); | ||
430 | 429 | ||
431 | discovery->data.daddr = info->daddr; | 430 | discovery->data.daddr = info->daddr; |
432 | discovery->data.saddr = self->saddr; | 431 | discovery->data.saddr = self->saddr; |
@@ -576,7 +575,7 @@ void irlap_send_rr_frame(struct irlap_cb *self, int command) | |||
576 | struct sk_buff *tx_skb; | 575 | struct sk_buff *tx_skb; |
577 | __u8 *frame; | 576 | __u8 *frame; |
578 | 577 | ||
579 | tx_skb = dev_alloc_skb(16); | 578 | tx_skb = alloc_skb(16, GFP_ATOMIC); |
580 | if (!tx_skb) | 579 | if (!tx_skb) |
581 | return; | 580 | return; |
582 | 581 | ||
@@ -601,7 +600,7 @@ void irlap_send_rd_frame(struct irlap_cb *self) | |||
601 | struct sk_buff *tx_skb; | 600 | struct sk_buff *tx_skb; |
602 | __u8 *frame; | 601 | __u8 *frame; |
603 | 602 | ||
604 | tx_skb = dev_alloc_skb(16); | 603 | tx_skb = alloc_skb(16, GFP_ATOMIC); |
605 | if (!tx_skb) | 604 | if (!tx_skb) |
606 | return; | 605 | return; |
607 | 606 | ||
@@ -1215,7 +1214,7 @@ void irlap_send_test_frame(struct irlap_cb *self, __u8 caddr, __u32 daddr, | |||
1215 | struct test_frame *frame; | 1214 | struct test_frame *frame; |
1216 | __u8 *info; | 1215 | __u8 *info; |
1217 | 1216 | ||
1218 | tx_skb = dev_alloc_skb(cmd->len+sizeof(struct test_frame)); | 1217 | tx_skb = alloc_skb(cmd->len+sizeof(struct test_frame), GFP_ATOMIC); |
1219 | if (!tx_skb) | 1218 | if (!tx_skb) |
1220 | return; | 1219 | return; |
1221 | 1220 | ||
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c index 129ad64c15bb..c440913dee14 100644 --- a/net/irda/irlmp.c +++ b/net/irda/irlmp.c | |||
@@ -78,10 +78,9 @@ int __init irlmp_init(void) | |||
78 | { | 78 | { |
79 | IRDA_DEBUG(1, "%s()\n", __FUNCTION__); | 79 | IRDA_DEBUG(1, "%s()\n", __FUNCTION__); |
80 | /* Initialize the irlmp structure. */ | 80 | /* Initialize the irlmp structure. */ |
81 | irlmp = kmalloc( sizeof(struct irlmp_cb), GFP_KERNEL); | 81 | irlmp = kzalloc( sizeof(struct irlmp_cb), GFP_KERNEL); |
82 | if (irlmp == NULL) | 82 | if (irlmp == NULL) |
83 | return -ENOMEM; | 83 | return -ENOMEM; |
84 | memset(irlmp, 0, sizeof(struct irlmp_cb)); | ||
85 | 84 | ||
86 | irlmp->magic = LMP_MAGIC; | 85 | irlmp->magic = LMP_MAGIC; |
87 | 86 | ||
@@ -160,12 +159,11 @@ struct lsap_cb *irlmp_open_lsap(__u8 slsap_sel, notify_t *notify, __u8 pid) | |||
160 | return NULL; | 159 | return NULL; |
161 | 160 | ||
162 | /* Allocate new instance of a LSAP connection */ | 161 | /* Allocate new instance of a LSAP connection */ |
163 | self = kmalloc(sizeof(struct lsap_cb), GFP_ATOMIC); | 162 | self = kzalloc(sizeof(struct lsap_cb), GFP_ATOMIC); |
164 | if (self == NULL) { | 163 | if (self == NULL) { |
165 | IRDA_ERROR("%s: can't allocate memory\n", __FUNCTION__); | 164 | IRDA_ERROR("%s: can't allocate memory\n", __FUNCTION__); |
166 | return NULL; | 165 | return NULL; |
167 | } | 166 | } |
168 | memset(self, 0, sizeof(struct lsap_cb)); | ||
169 | 167 | ||
170 | self->magic = LMP_LSAP_MAGIC; | 168 | self->magic = LMP_LSAP_MAGIC; |
171 | self->slsap_sel = slsap_sel; | 169 | self->slsap_sel = slsap_sel; |
@@ -288,12 +286,11 @@ void irlmp_register_link(struct irlap_cb *irlap, __u32 saddr, notify_t *notify) | |||
288 | /* | 286 | /* |
289 | * Allocate new instance of a LSAP connection | 287 | * Allocate new instance of a LSAP connection |
290 | */ | 288 | */ |
291 | lap = kmalloc(sizeof(struct lap_cb), GFP_KERNEL); | 289 | lap = kzalloc(sizeof(struct lap_cb), GFP_KERNEL); |
292 | if (lap == NULL) { | 290 | if (lap == NULL) { |
293 | IRDA_ERROR("%s: unable to kmalloc\n", __FUNCTION__); | 291 | IRDA_ERROR("%s: unable to kmalloc\n", __FUNCTION__); |
294 | return; | 292 | return; |
295 | } | 293 | } |
296 | memset(lap, 0, sizeof(struct lap_cb)); | ||
297 | 294 | ||
298 | lap->irlap = irlap; | 295 | lap->irlap = irlap; |
299 | lap->magic = LMP_LAP_MAGIC; | 296 | lap->magic = LMP_LAP_MAGIC; |
@@ -395,7 +392,7 @@ int irlmp_connect_request(struct lsap_cb *self, __u8 dlsap_sel, | |||
395 | 392 | ||
396 | /* Any userdata? */ | 393 | /* Any userdata? */ |
397 | if (tx_skb == NULL) { | 394 | if (tx_skb == NULL) { |
398 | tx_skb = dev_alloc_skb(64); | 395 | tx_skb = alloc_skb(64, GFP_ATOMIC); |
399 | if (!tx_skb) | 396 | if (!tx_skb) |
400 | return -ENOMEM; | 397 | return -ENOMEM; |
401 | 398 | ||
diff --git a/net/irda/irnet/irnet_ppp.c b/net/irda/irnet/irnet_ppp.c index e53bf9e0053e..a1e502ff9070 100644 --- a/net/irda/irnet/irnet_ppp.c +++ b/net/irda/irnet/irnet_ppp.c | |||
@@ -476,11 +476,10 @@ dev_irnet_open(struct inode * inode, | |||
476 | #endif /* SECURE_DEVIRNET */ | 476 | #endif /* SECURE_DEVIRNET */ |
477 | 477 | ||
478 | /* Allocate a private structure for this IrNET instance */ | 478 | /* Allocate a private structure for this IrNET instance */ |
479 | ap = kmalloc(sizeof(*ap), GFP_KERNEL); | 479 | ap = kzalloc(sizeof(*ap), GFP_KERNEL); |
480 | DABORT(ap == NULL, -ENOMEM, FS_ERROR, "Can't allocate struct irnet...\n"); | 480 | DABORT(ap == NULL, -ENOMEM, FS_ERROR, "Can't allocate struct irnet...\n"); |
481 | 481 | ||
482 | /* initialize the irnet structure */ | 482 | /* initialize the irnet structure */ |
483 | memset(ap, 0, sizeof(*ap)); | ||
484 | ap->file = file; | 483 | ap->file = file; |
485 | 484 | ||
486 | /* PPP channel setup */ | 485 | /* PPP channel setup */ |
diff --git a/net/irda/irttp.c b/net/irda/irttp.c index 49c51c5f1a86..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 | ||
@@ -306,7 +305,8 @@ static inline void irttp_fragment_skb(struct tsap_cb *self, | |||
306 | IRDA_DEBUG(2, "%s(), fragmenting ...\n", __FUNCTION__); | 305 | IRDA_DEBUG(2, "%s(), fragmenting ...\n", __FUNCTION__); |
307 | 306 | ||
308 | /* Make new segment */ | 307 | /* Make new segment */ |
309 | frag = dev_alloc_skb(self->max_seg_size+self->max_header_size); | 308 | frag = alloc_skb(self->max_seg_size+self->max_header_size, |
309 | GFP_ATOMIC); | ||
310 | if (!frag) | 310 | if (!frag) |
311 | return; | 311 | return; |
312 | 312 | ||
@@ -389,12 +389,11 @@ struct tsap_cb *irttp_open_tsap(__u8 stsap_sel, int credit, notify_t *notify) | |||
389 | return NULL; | 389 | return NULL; |
390 | } | 390 | } |
391 | 391 | ||
392 | self = kmalloc(sizeof(struct tsap_cb), GFP_ATOMIC); | 392 | self = kzalloc(sizeof(struct tsap_cb), GFP_ATOMIC); |
393 | if (self == NULL) { | 393 | if (self == NULL) { |
394 | IRDA_DEBUG(0, "%s(), unable to kmalloc!\n", __FUNCTION__); | 394 | IRDA_DEBUG(0, "%s(), unable to kmalloc!\n", __FUNCTION__); |
395 | return NULL; | 395 | return NULL; |
396 | } | 396 | } |
397 | memset(self, 0, sizeof(struct tsap_cb)); | ||
398 | spin_lock_init(&self->lock); | 397 | spin_lock_init(&self->lock); |
399 | 398 | ||
400 | /* Initialise todo timer */ | 399 | /* Initialise todo timer */ |
@@ -805,7 +804,7 @@ static inline void irttp_give_credit(struct tsap_cb *self) | |||
805 | self->send_credit, self->avail_credit, self->remote_credit); | 804 | self->send_credit, self->avail_credit, self->remote_credit); |
806 | 805 | ||
807 | /* Give credit to peer */ | 806 | /* Give credit to peer */ |
808 | tx_skb = dev_alloc_skb(64); | 807 | tx_skb = alloc_skb(64, GFP_ATOMIC); |
809 | if (!tx_skb) | 808 | if (!tx_skb) |
810 | return; | 809 | return; |
811 | 810 | ||
@@ -1094,7 +1093,7 @@ int irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel, | |||
1094 | 1093 | ||
1095 | /* Any userdata supplied? */ | 1094 | /* Any userdata supplied? */ |
1096 | if (userdata == NULL) { | 1095 | if (userdata == NULL) { |
1097 | tx_skb = dev_alloc_skb(64); | 1096 | tx_skb = alloc_skb(64, GFP_ATOMIC); |
1098 | if (!tx_skb) | 1097 | if (!tx_skb) |
1099 | return -ENOMEM; | 1098 | return -ENOMEM; |
1100 | 1099 | ||
@@ -1342,7 +1341,7 @@ int irttp_connect_response(struct tsap_cb *self, __u32 max_sdu_size, | |||
1342 | 1341 | ||
1343 | /* Any userdata supplied? */ | 1342 | /* Any userdata supplied? */ |
1344 | if (userdata == NULL) { | 1343 | if (userdata == NULL) { |
1345 | tx_skb = dev_alloc_skb(64); | 1344 | tx_skb = alloc_skb(64, GFP_ATOMIC); |
1346 | if (!tx_skb) | 1345 | if (!tx_skb) |
1347 | return -ENOMEM; | 1346 | return -ENOMEM; |
1348 | 1347 | ||
@@ -1541,7 +1540,7 @@ int irttp_disconnect_request(struct tsap_cb *self, struct sk_buff *userdata, | |||
1541 | 1540 | ||
1542 | if (!userdata) { | 1541 | if (!userdata) { |
1543 | struct sk_buff *tx_skb; | 1542 | struct sk_buff *tx_skb; |
1544 | tx_skb = dev_alloc_skb(64); | 1543 | tx_skb = alloc_skb(64, GFP_ATOMIC); |
1545 | if (!tx_skb) | 1544 | if (!tx_skb) |
1546 | return -ENOMEM; | 1545 | return -ENOMEM; |
1547 | 1546 | ||
@@ -1876,7 +1875,7 @@ static int irttp_seq_open(struct inode *inode, struct file *file) | |||
1876 | int rc = -ENOMEM; | 1875 | int rc = -ENOMEM; |
1877 | struct irttp_iter_state *s; | 1876 | struct irttp_iter_state *s; |
1878 | 1877 | ||
1879 | s = kmalloc(sizeof(*s), GFP_KERNEL); | 1878 | s = kzalloc(sizeof(*s), GFP_KERNEL); |
1880 | if (!s) | 1879 | if (!s) |
1881 | goto out; | 1880 | goto out; |
1882 | 1881 | ||
@@ -1886,7 +1885,6 @@ static int irttp_seq_open(struct inode *inode, struct file *file) | |||
1886 | 1885 | ||
1887 | seq = file->private_data; | 1886 | seq = file->private_data; |
1888 | seq->private = s; | 1887 | seq->private = s; |
1889 | memset(s, 0, sizeof(*s)); | ||
1890 | out: | 1888 | out: |
1891 | return rc; | 1889 | return rc; |
1892 | out_kfree: | 1890 | out_kfree: |