[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100523-patch-gigaset-01.tilman@imap.cc>
Date: Sun, 23 May 2010 13:02:08 +0200 (CEST)
From: Tilman Schmidt <tilman@...p.cc>
To: Karsten Keil <isdn@...ux-pingi.de>,
David Miller <davem@...emloft.net>
CC: Hansjoerg Lipp <hjlipp@....de>, Karsten Keil <keil@...systems.de>,
i4ldeveloper@...tserv.isdn4linux.de, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] isdn/capi: make reset_ctr op truly optional
The CAPI controller operation reset_ctr is marked as optional, and
not all drivers do implement it. Add a check to the kernel CAPI
whether it exists before trying to call it.
Impact: oops prevention
Signed-off-by: Tilman Schmidt <tilman@...p.cc>
---
drivers/isdn/capi/kcapi.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c
index bd00dce..bde3c88 100644
--- a/drivers/isdn/capi/kcapi.c
+++ b/drivers/isdn/capi/kcapi.c
@@ -1147,6 +1147,12 @@ load_unlock_out:
if (ctr->state == CAPI_CTR_DETECTED)
goto reset_unlock_out;
+ if (ctr->reset_ctr == NULL) {
+ printk(KERN_DEBUG "kcapi: reset: no reset function\n");
+ retval = -ESRCH;
+ goto reset_unlock_out;
+ }
+
ctr->reset_ctr(ctr);
retval = wait_on_ctr_state(ctr, CAPI_CTR_DETECTED);
--
1.6.5.3.298.g39add
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists