Commit 08cb3f60 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

misdn: Fix reversed 'if' in st_own_ctrl

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: default avatarDan Carpenter <error27@gmail.com>
Cc: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 02303d20
...@@ -364,7 +364,7 @@ add_layer2(struct mISDNchannel *ch, struct mISDNstack *st) ...@@ -364,7 +364,7 @@ add_layer2(struct mISDNchannel *ch, struct mISDNstack *st)
static int static int
st_own_ctrl(struct mISDNchannel *ch, u_int cmd, void *arg) 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 -EINVAL;
return ch->st->layer1->ctrl(ch->st->layer1, cmd, arg); return ch->st->layer1->ctrl(ch->st->layer1, cmd, arg);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment