]> git.hungrycats.org Git - linux/commitdiff
[PATCH] 6pack reinit bug
authorJeroen Vreeken <pe1rxq@amsat.org>
Wed, 18 Feb 2004 13:49:32 +0000 (08:49 -0500)
committerStephen Hemminger <shemminger@osdl.org>
Wed, 18 Feb 2004 13:49:32 +0000 (08:49 -0500)
This patch is the same as to mkiss a while ago, the current code triggers a
bug when reattaching a network device.

drivers/net/hamradio/6pack.c

index 91ceae8f5339e08f39b591c4a75a8616dfe128fc..abe4ee43bf0b61413432ba69a21b1f7406454a45 100644 (file)
@@ -178,17 +178,17 @@ static inline struct sixpack *sp_alloc(void)
            (sixpack_ctrls[i] = (sixpack_ctrl_t *)kmalloc(sizeof(sixpack_ctrl_t),
                                                    GFP_KERNEL)) != NULL) {
                spp = sixpack_ctrls[i];
-               memset(spp, 0, sizeof(sixpack_ctrl_t));
-
-               /* Initialize channel control data */
-               set_bit(SIXPF_INUSE, &spp->ctrl.flags);
-               spp->ctrl.tty         = NULL;
-               sprintf(spp->dev.name, "sp%d", i);
-               spp->dev.base_addr    = i;
-               spp->dev.priv         = (void *) &spp->ctrl;
-               spp->dev.next         = NULL;
-               spp->dev.init         = sixpack_init;
        }
+       memset(spp, 0, sizeof(sixpack_ctrl_t));
+
+       /* Initialize channel control data */
+       set_bit(SIXPF_INUSE, &spp->ctrl.flags);
+       spp->ctrl.tty         = NULL;
+       sprintf(spp->dev.name, "sp%d", i);
+       spp->dev.base_addr    = i;
+       spp->dev.priv         = (void *) &spp->ctrl;
+       spp->dev.next         = NULL;
+       spp->dev.init         = sixpack_init;
 
        if (spp != NULL) {
                /* register device so that it can be ifconfig'ed       */