summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi-base.c
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-06-02 20:01:10 +0000
committerShaun Ruffell <sruffell@digium.com>2011-06-02 20:01:10 +0000
commit07f5c4e9bfbd4a22c6473f19e9fd75b45abf5fe7 (patch)
treefa55af91fb5ac524049bcbe78c3de7c7a5c1ebe5 /drivers/dahdi/dahdi-base.c
parent13d540c9175822791c797fe11bb9034ebad7593c (diff)
dahdi: Propagate shutdown returncode to user space.
This change fixes a condition where 'dahdi_cfg -s' would always return success regardless of whether a board driver was able to complete the shutdown. Only impacts board drivers that implemented the shutdown span callback. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9935 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/dahdi-base.c')
-rw-r--r--drivers/dahdi/dahdi-base.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 9b83025..fac7d28 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -4754,7 +4754,6 @@ static int dahdi_ioctl_shutdown(unsigned long data)
{
/* I/O CTL's for control interface */
int j;
- int res = 0;
int x;
struct dahdi_span *s;
@@ -4768,8 +4767,14 @@ static int dahdi_ioctl_shutdown(unsigned long data)
for (x = 0; x < s->channels; x++)
s->chans[x]->sig = 0;
- if (s->ops->shutdown)
- res = s->ops->shutdown(s);
+ if (s->ops->shutdown) {
+ int res = s->ops->shutdown(s);
+ if (res) {
+ put_span(s);
+ return res;
+ }
+ }
+
s->flags &= ~DAHDI_FLAG_RUNNING;
put_span(s);
return 0;