Skip to content

Commit 84f60ca

Browse files
jhovoldgregkh
authored andcommitted
staging: gigaset: fix illegal free on probe errors
The driver failed to initialise its receive-buffer pointer, something which could lead to an illegal free on late probe errors. Fix this by making sure to clear all driver data at allocation. Fixes: 2032e2c ("usb_gigaset: code cleanup") Cc: stable <[email protected]> # 2.6.33 Cc: Tilman Schmidt <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 53f35a3 commit 84f60ca

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

drivers/staging/isdn/gigaset/usb-gigaset.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,7 @@ static int gigaset_initcshw(struct cardstate *cs)
571571
{
572572
struct usb_cardstate *ucs;
573573

574-
cs->hw.usb = ucs =
575-
kmalloc(sizeof(struct usb_cardstate), GFP_KERNEL);
574+
cs->hw.usb = ucs = kzalloc(sizeof(struct usb_cardstate), GFP_KERNEL);
576575
if (!ucs) {
577576
pr_err("out of memory\n");
578577
return -ENOMEM;
@@ -584,9 +583,6 @@ static int gigaset_initcshw(struct cardstate *cs)
584583
ucs->bchars[3] = 0;
585584
ucs->bchars[4] = 0x11;
586585
ucs->bchars[5] = 0x13;
587-
ucs->bulk_out_buffer = NULL;
588-
ucs->bulk_out_urb = NULL;
589-
ucs->read_urb = NULL;
590586
tasklet_init(&cs->write_tasklet,
591587
gigaset_modem_fill, (unsigned long) cs);
592588

0 commit comments

Comments
 (0)