aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/mon/mon_text.c4
-rw-r--r--drivers/usb/serial/ipaq.c10
2 files changed, 8 insertions, 6 deletions
diff --git a/drivers/usb/mon/mon_text.c b/drivers/usb/mon/mon_text.c
index 5e3e4e9b6c77..1f715436d6d3 100644
--- a/drivers/usb/mon/mon_text.c
+++ b/drivers/usb/mon/mon_text.c
@@ -87,7 +87,7 @@ struct mon_reader_text {
87 87
88static struct dentry *mon_dir; /* Usually /sys/kernel/debug/usbmon */ 88static struct dentry *mon_dir; /* Usually /sys/kernel/debug/usbmon */
89 89
90static void mon_text_ctor(struct kmem_cache *, void *); 90static void mon_text_ctor(void *);
91 91
92struct mon_text_ptr { 92struct mon_text_ptr {
93 int cnt, limit; 93 int cnt, limit;
@@ -720,7 +720,7 @@ void mon_text_del(struct mon_bus *mbus)
720/* 720/*
721 * Slab interface: constructor. 721 * Slab interface: constructor.
722 */ 722 */
723static void mon_text_ctor(struct kmem_cache *slab, void *mem) 723static void mon_text_ctor(void *mem)
724{ 724{
725 /* 725 /*
726 * Nothing to initialize. No, really! 726 * Nothing to initialize. No, really!
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index 832a5a4f3cb3..cd9a2e138c8b 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -651,15 +651,17 @@ static int ipaq_open(struct tty_struct *tty,
651 */ 651 */
652 652
653 kfree(port->bulk_in_buffer); 653 kfree(port->bulk_in_buffer);
654 kfree(port->bulk_out_buffer);
655 /* make sure the generic serial code knows */
656 port->bulk_out_buffer = NULL;
657
654 port->bulk_in_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL); 658 port->bulk_in_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL);
655 if (port->bulk_in_buffer == NULL) { 659 if (port->bulk_in_buffer == NULL)
656 port->bulk_out_buffer = NULL; /* prevent double free */
657 goto enomem; 660 goto enomem;
658 }
659 661
660 kfree(port->bulk_out_buffer);
661 port->bulk_out_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL); 662 port->bulk_out_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL);
662 if (port->bulk_out_buffer == NULL) { 663 if (port->bulk_out_buffer == NULL) {
664 /* the buffer is useless, free it */
663 kfree(port->bulk_in_buffer); 665 kfree(port->bulk_in_buffer);
664 port->bulk_in_buffer = NULL; 666 port->bulk_in_buffer = NULL;
665 goto enomem; 667 goto enomem;