aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/gigaset/bas-gigaset.c16
-rw-r--r--drivers/isdn/hardware/mISDN/hfcmulti.c2
-rw-r--r--drivers/isdn/sc/shmem.c2
3 files changed, 16 insertions, 4 deletions
diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
index 18dd8aacbe8..831ddce1467 100644
--- a/drivers/isdn/gigaset/bas-gigaset.c
+++ b/drivers/isdn/gigaset/bas-gigaset.c
@@ -46,6 +46,9 @@ MODULE_PARM_DESC(cidmode, "Call-ID mode");
46/* length limit according to Siemens 3070usb-protokoll.doc ch. 2.1 */ 46/* length limit according to Siemens 3070usb-protokoll.doc ch. 2.1 */
47#define IF_WRITEBUF 264 47#define IF_WRITEBUF 264
48 48
49/* interrupt pipe message size according to ibid. ch. 2.2 */
50#define IP_MSGSIZE 3
51
49/* Values for the Gigaset 307x */ 52/* Values for the Gigaset 307x */
50#define USB_GIGA_VENDOR_ID 0x0681 53#define USB_GIGA_VENDOR_ID 0x0681
51#define USB_3070_PRODUCT_ID 0x0001 54#define USB_3070_PRODUCT_ID 0x0001
@@ -110,7 +113,7 @@ struct bas_cardstate {
110 unsigned char *rcvbuf; /* AT reply receive buffer */ 113 unsigned char *rcvbuf; /* AT reply receive buffer */
111 114
112 struct urb *urb_int_in; /* URB for interrupt pipe */ 115 struct urb *urb_int_in; /* URB for interrupt pipe */
113 unsigned char int_in_buf[3]; 116 unsigned char *int_in_buf;
114 117
115 spinlock_t lock; /* locks all following */ 118 spinlock_t lock; /* locks all following */
116 int basstate; /* bitmap (BS_*) */ 119 int basstate; /* bitmap (BS_*) */
@@ -657,7 +660,7 @@ static void read_int_callback(struct urb *urb)
657 } 660 }
658 661
659 /* drop incomplete packets even if the missing bytes wouldn't matter */ 662 /* drop incomplete packets even if the missing bytes wouldn't matter */
660 if (unlikely(urb->actual_length < 3)) { 663 if (unlikely(urb->actual_length < IP_MSGSIZE)) {
661 dev_warn(cs->dev, "incomplete interrupt packet (%d bytes)\n", 664 dev_warn(cs->dev, "incomplete interrupt packet (%d bytes)\n",
662 urb->actual_length); 665 urb->actual_length);
663 goto resubmit; 666 goto resubmit;
@@ -2127,6 +2130,7 @@ static void gigaset_reinitbcshw(struct bc_state *bcs)
2127static void gigaset_freecshw(struct cardstate *cs) 2130static void gigaset_freecshw(struct cardstate *cs)
2128{ 2131{
2129 /* timers, URBs and rcvbuf are disposed of in disconnect */ 2132 /* timers, URBs and rcvbuf are disposed of in disconnect */
2133 kfree(cs->hw.bas->int_in_buf);
2130 kfree(cs->hw.bas); 2134 kfree(cs->hw.bas);
2131 cs->hw.bas = NULL; 2135 cs->hw.bas = NULL;
2132} 2136}
@@ -2140,6 +2144,12 @@ static int gigaset_initcshw(struct cardstate *cs)
2140 pr_err("out of memory\n"); 2144 pr_err("out of memory\n");
2141 return 0; 2145 return 0;
2142 } 2146 }
2147 ucs->int_in_buf = kmalloc(IP_MSGSIZE, GFP_KERNEL);
2148 if (!ucs->int_in_buf) {
2149 kfree(ucs);
2150 pr_err("out of memory\n");
2151 return 0;
2152 }
2143 2153
2144 ucs->urb_cmd_in = NULL; 2154 ucs->urb_cmd_in = NULL;
2145 ucs->urb_cmd_out = NULL; 2155 ucs->urb_cmd_out = NULL;
@@ -2292,7 +2302,7 @@ static int gigaset_probe(struct usb_interface *interface,
2292 usb_fill_int_urb(ucs->urb_int_in, udev, 2302 usb_fill_int_urb(ucs->urb_int_in, udev,
2293 usb_rcvintpipe(udev, 2303 usb_rcvintpipe(udev,
2294 (endpoint->bEndpointAddress) & 0x0f), 2304 (endpoint->bEndpointAddress) & 0x0f),
2295 ucs->int_in_buf, 3, read_int_callback, cs, 2305 ucs->int_in_buf, IP_MSGSIZE, read_int_callback, cs,
2296 endpoint->bInterval); 2306 endpoint->bInterval);
2297 if ((rc = usb_submit_urb(ucs->urb_int_in, GFP_KERNEL)) != 0) { 2307 if ((rc = usb_submit_urb(ucs->urb_int_in, GFP_KERNEL)) != 0) {
2298 dev_err(cs->dev, "could not submit interrupt URB: %s\n", 2308 dev_err(cs->dev, "could not submit interrupt URB: %s\n",
diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c
index 595ba8eb4a0..0b28141e43b 100644
--- a/drivers/isdn/hardware/mISDN/hfcmulti.c
+++ b/drivers/isdn/hardware/mISDN/hfcmulti.c
@@ -4599,6 +4599,7 @@ init_e1_port(struct hfc_multi *hc, struct hm_map *m)
4599 printk(KERN_ERR "%s: no memory for coeffs\n", 4599 printk(KERN_ERR "%s: no memory for coeffs\n",
4600 __func__); 4600 __func__);
4601 ret = -ENOMEM; 4601 ret = -ENOMEM;
4602 kfree(bch);
4602 goto free_chan; 4603 goto free_chan;
4603 } 4604 }
4604 bch->nr = ch; 4605 bch->nr = ch;
@@ -4767,6 +4768,7 @@ init_multi_port(struct hfc_multi *hc, int pt)
4767 printk(KERN_ERR "%s: no memory for coeffs\n", 4768 printk(KERN_ERR "%s: no memory for coeffs\n",
4768 __func__); 4769 __func__);
4769 ret = -ENOMEM; 4770 ret = -ENOMEM;
4771 kfree(bch);
4770 goto free_chan; 4772 goto free_chan;
4771 } 4773 }
4772 bch->nr = ch + 1; 4774 bch->nr = ch + 1;
diff --git a/drivers/isdn/sc/shmem.c b/drivers/isdn/sc/shmem.c
index 712220cef13..7f16d75d2d8 100644
--- a/drivers/isdn/sc/shmem.c
+++ b/drivers/isdn/sc/shmem.c
@@ -54,7 +54,7 @@ void memcpy_toshmem(int card, void *dest, const void *src, size_t n)
54 spin_unlock_irqrestore(&sc_adapter[card]->lock, flags); 54 spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
55 pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename, 55 pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename,
56 ((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80); 56 ((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80);
57 pr_debug("%s: copying %d bytes from %#lx to %#lx\n", 57 pr_debug("%s: copying %zu bytes from %#lx to %#lx\n",
58 sc_adapter[card]->devicename, n, 58 sc_adapter[card]->devicename, n,
59 (unsigned long) src, 59 (unsigned long) src,
60 sc_adapter[card]->rambase + ((unsigned long) dest %0x4000)); 60 sc_adapter[card]->rambase + ((unsigned long) dest %0x4000));