]> git.ipfire.org Git - people/ms/linux.git/commitdiff
Fix incorrect stable backport to bas_gigaset
authorTilman Schmidt <tilman@imap.cc>
Tue, 25 Aug 2009 15:35:56 +0000 (17:35 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Oct 2009 15:11:45 +0000 (08:11 -0700)
bas_gigaset: correctly allocate USB interrupt transfer buffer

[ Upstream commit 170ebf85160dd128e1c4206cc197cce7d1424705 ]

This incorrect backport to 2.6.28.10 placed some code into the probe function
which used a pointer before it was initialized. Moving this to the correct
place (as it is in upstream).

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Steve Conklin <steve.conklin@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/isdn/gigaset/bas-gigaset.c

index fcec2dfc9963e30405ddb4825a0c84fda113918f..3990eae818252de8b16a02d3d636d8fbd27f4ee2 100644 (file)
@@ -2140,8 +2140,16 @@ static int gigaset_initcshw(struct cardstate *cs)
        struct bas_cardstate *ucs;
 
        cs->hw.bas = ucs = kmalloc(sizeof *ucs, GFP_KERNEL);
-       if (!ucs)
+       if (!ucs) {
+               pr_err("out of memory\n");
+               return 0;
+       }
+       ucs->int_in_buf = kmalloc(IP_MSGSIZE, GFP_KERNEL);
+       if (!ucs->int_in_buf) {
+               kfree(ucs);
+               pr_err("out of memory\n");
                return 0;
+       }
 
        ucs->urb_cmd_in = NULL;
        ucs->urb_cmd_out = NULL;
@@ -2236,12 +2244,6 @@ static int gigaset_probe(struct usb_interface *interface,
                }
                hostif = interface->cur_altsetting;
        }
-       ucs->int_in_buf = kmalloc(IP_MSGSIZE, GFP_KERNEL);
-       if (!ucs->int_in_buf) {
-               kfree(ucs);
-               pr_err("out of memory\n");
-               return 0;
-       }
 
        /* Reject application specific interfaces
         */