Skip to contentSkip to conversation

i4l/isdn_tty.c: fix a check-after-use

PATCH New Adrian Bunk 1 participant 1 message Mar 15, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i4l/isdn_tty.c: fix a check-after-use

This patch fixes a check-after-use spotted by the Coverity checker.

drivers/isdn/i4l/isdn_tty.c renamed from drivers/isdn/i4l/isdn_tty.c.old +4 -1
@@ -2345,12 +2345,15 @@ isdn_tty_at_cout(char *msg, modem_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)) {