[patch] mISDN: fix reversed if in st_own_ctrl()

From: Dan Carpenter
Date: Fri Aug 07 2009 - 08:11:36 EST


The current code probably returns -EINVAL a lot. Otherwise it would oops.

Compile tested only. Found by smatch (http://repo.or.cz/w/smatch.git).

regards,
dan carpenter

Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>

--- orig/drivers/isdn/mISDN/stack.c 2009-07-17 13:34:57.000000000 +0300
+++ new/drivers/isdn/mISDN/stack.c 2009-07-17 13:35:32.000000000 +0300
@@ -364,7 +364,7 @@
static int
st_own_ctrl(struct mISDNchannel *ch, u_int cmd, void *arg)
{
- if (!ch->st || ch->st->layer1)
+ if (!ch->st || !ch->st->layer1)
return -EINVAL;
return ch->st->layer1->ctrl(ch->st->layer1, cmd, arg);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/