Netdev List
 help / color / mirror / Atom feed
* [patch 4/6] mISDN: fix reversed if in st_own_ctrl()
@ 2009-09-18 19:53 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2009-09-18 19:53 UTC (permalink / raw)
  To: isdn; +Cc: netdev, akpm, error27

From: Dan Carpenter <error27@gmail.com>

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>
---

 drivers/isdn/mISDN/stack.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/isdn/mISDN/stack.c~misdn-fix-reversed-if-in-st_own_ctrl drivers/isdn/mISDN/stack.c
--- a/drivers/isdn/mISDN/stack.c~misdn-fix-reversed-if-in-st_own_ctrl
+++ a/drivers/isdn/mISDN/stack.c
@@ -364,7 +364,7 @@ add_layer2(struct mISDNchannel *ch, stru
 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);
 }
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-09-18 20:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-18 19:53 [patch 4/6] mISDN: fix reversed if in st_own_ctrl() akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox