misdn: Fix reversed 'if' in st_own_ctrl
authorDan Carpenter <error27@gmail.com>
Wed, 4 Nov 2009 16:27:09 +0000 (08:27 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Nov 2009 16:27:09 +0000 (08:27 -0800)
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).

Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/isdn/mISDN/stack.c

index 3e1532a180ff172df2c92f2c19e8bb3ecdc9f1cd..0d05ec43012cf14104cf4ef96f4ec0cc780ae6cd 100644 (file)
@@ -364,7 +364,7 @@ add_layer2(struct mISDNchannel *ch, struct mISDNstack *st)
 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);
 }