aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/ircomm/ircomm_tty.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/irda/ircomm/ircomm_tty.c')
-rw-r--r--net/irda/ircomm/ircomm_tty.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
index 6f20b4206e08..3bcdb467efc5 100644
--- a/net/irda/ircomm/ircomm_tty.c
+++ b/net/irda/ircomm/ircomm_tty.c
@@ -30,7 +30,6 @@
30 * 30 *
31 ********************************************************************/ 31 ********************************************************************/
32 32
33#include <linux/config.h>
34#include <linux/init.h> 33#include <linux/init.h>
35#include <linux/module.h> 34#include <linux/module.h>
36#include <linux/fs.h> 35#include <linux/fs.h>
@@ -124,7 +123,6 @@ static int __init ircomm_tty_init(void)
124 driver->owner = THIS_MODULE; 123 driver->owner = THIS_MODULE;
125 driver->driver_name = "ircomm"; 124 driver->driver_name = "ircomm";
126 driver->name = "ircomm"; 125 driver->name = "ircomm";
127 driver->devfs_name = "ircomm";
128 driver->major = IRCOMM_TTY_MAJOR; 126 driver->major = IRCOMM_TTY_MAJOR;
129 driver->minor_start = IRCOMM_TTY_MINOR; 127 driver->minor_start = IRCOMM_TTY_MINOR;
130 driver->type = TTY_DRIVER_TYPE_SERIAL; 128 driver->type = TTY_DRIVER_TYPE_SERIAL;
@@ -381,12 +379,11 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
381 self = hashbin_lock_find(ircomm_tty, line, NULL); 379 self = hashbin_lock_find(ircomm_tty, line, NULL);
382 if (!self) { 380 if (!self) {
383 /* No, so make new instance */ 381 /* No, so make new instance */
384 self = kmalloc(sizeof(struct ircomm_tty_cb), GFP_KERNEL); 382 self = kzalloc(sizeof(struct ircomm_tty_cb), GFP_KERNEL);
385 if (self == NULL) { 383 if (self == NULL) {
386 IRDA_ERROR("%s(), kmalloc failed!\n", __FUNCTION__); 384 IRDA_ERROR("%s(), kmalloc failed!\n", __FUNCTION__);
387 return -ENOMEM; 385 return -ENOMEM;
388 } 386 }
389 memset(self, 0, sizeof(struct ircomm_tty_cb));
390 387
391 self->magic = IRCOMM_TTY_MAGIC; 388 self->magic = IRCOMM_TTY_MAGIC;
392 self->flow = FLOW_STOP; 389 self->flow = FLOW_STOP;
@@ -761,8 +758,9 @@ static int ircomm_tty_write(struct tty_struct *tty,
761 } 758 }
762 } else { 759 } else {
763 /* Prepare a full sized frame */ 760 /* Prepare a full sized frame */
764 skb = dev_alloc_skb(self->max_data_size+ 761 skb = alloc_skb(self->max_data_size+
765 self->max_header_size); 762 self->max_header_size,
763 GFP_ATOMIC);
766 if (!skb) { 764 if (!skb) {
767 spin_unlock_irqrestore(&self->spinlock, flags); 765 spin_unlock_irqrestore(&self->spinlock, flags);
768 return -ENOBUFS; 766 return -ENOBUFS;