[2.6 patch] i4l/isdn_tty.c: fix a check-after-use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


Signed-off-by: Adrian Bunk <[email protected]>

--- linux-2.6.16-rc6-mm1-full/drivers/isdn/i4l/isdn_tty.c.old	2006-03-14 02:41:38.000000000 +0100
+++ linux-2.6.16-rc6-mm1-full/drivers/isdn/i4l/isdn_tty.c	2006-03-14 02:42:10.000000000 +0100
@@ -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)) {

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux