diff options
author | Tilman Schmidt <tilman@imap.cc> | 2010-05-23 01:02:08 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-02 10:30:09 -0700 |
commit | b83839af65811ffdce669ecbec121ba11c2be594 (patch) | |
tree | 0473d938361dc40094002107c13ad346f3d25d5f | |
parent | f082cf1cd3aa3df00aaf1f273994266140006680 (diff) | |
download | lwn-b83839af65811ffdce669ecbec121ba11c2be594.tar.gz lwn-b83839af65811ffdce669ecbec121ba11c2be594.zip |
isdn/capi: make reset_ctr op truly optional
commit 85a83560afa69862639fb2d6f670b4440a003335 upstream.
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.
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Acked-by: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | 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 bd00dceacaf0..bde3c88b8b27 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); |