From: Tilman Schmidt Date: Sun, 23 May 2010 01:02:08 +0000 (+0000) Subject: isdn/capi: make reset_ctr op truly optional X-Git-Tag: v2.6.35-rc1~260^2~17 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=85a83560afa69862639fb2d6f670b4440a003335;p=~emulex%2Finfiniband.git 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. Signed-off-by: Tilman Schmidt Acked-by: Karsten Keil Signed-off-by: David S. Miller --- diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c index bd00dceacaf..bde3c88b8b2 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);