[PATCH] i4l/isdn_tty.c: fix a check-after-use
authorAdrian Bunk <bunk@stusta.de>
Sat, 25 Mar 2006 11:08:06 +0000 (03:08 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 25 Mar 2006 16:22:59 +0000 (08:22 -0800)
Fix a check-after-use spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Cc: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/isdn/i4l/isdn_tty.c

index aeaa1db..3585fb1 100644 (file)
@@ -2345,12 +2345,15 @@ isdn_tty_at_cout(char *msg, modem_info * info)
        u_long flags;
        struct sk_buff *skb = NULL;
        char *sp = NULL;
-       int l = strlen(msg);
+       int l;
 
        if (!msg) {
                printk(KERN_WARNING "isdn_tty: Null-Message in isdn_tty_at_cout\n");
                return;
        }
+
+       l = strlen(msg);
+
        spin_lock_irqsave(&info->readlock, flags);
        tty = info->tty;
        if ((info->flags & ISDN_ASYNC_CLOSING) || (!tty)) {