diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-07-24 03:38:13 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-07-24 03:38:13 -0400 |
commit | b71426eb10d904d421b36f51f93c8d0ba558edac (patch) | |
tree | a8c7088a6b89499134e01750652aa55f2baa890f /net/irda/ircomm/ircomm_tty.c | |
parent | 8419dc8a34d765f2ff1aa4051084d54cfeff09cf (diff) | |
parent | abb5a5cc6bba1516403146c5b79036fe843beb70 (diff) |
Merge branch 'master' into upstream-fixes
Diffstat (limited to 'net/irda/ircomm/ircomm_tty.c')
-rw-r--r-- | net/irda/ircomm/ircomm_tty.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; |