]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/hamradio/6pack.c
drivers/net/hamradio/6pack.c: move a dereference below a NULL test
[linux-2.6-omap-h63xx.git] / drivers / net / hamradio / 6pack.c
index 50f1e172ee8f9556a09e7fbdb1ab05f69c09f74e..2d4089894ec7b13c61f7626c95b8fa991ca104a5 100644 (file)
@@ -717,11 +717,12 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file,
        unsigned int cmd, unsigned long arg)
 {
        struct sixpack *sp = sp_get(tty);
-       struct net_device *dev = sp->dev;
+       struct net_device *dev;
        unsigned int tmp, err;
 
        if (!sp)
                return -ENXIO;
+       dev = sp->dev;
 
        switch(cmd) {
        case SIOCGIFNAME: