[asterisk-bugs] [DAHDI-linux 0018422]: dahdi-base locks channel-exporting module in kernel if channel open fails

Asterisk Bug Tracker noreply at bugs.digium.com
Sun Dec 5 07:51:34 CST 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18422 
====================================================================== 
Reported By:                avarvit
Assigned To:                
====================================================================== 
Project:                    DAHDI-linux
Issue ID:                   18422
Category:                   dahdi (the module)
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
JIRA:                        
Reviewboard Link:            
====================================================================== 
Date Submitted:             2010-12-03 23:21 CST
Last Modified:              2010-12-05 07:51 CST
====================================================================== 
Summary:                    dahdi-base locks channel-exporting module in kernel
if channel open fails
Description: 
If chan->span->ops->open() fails, then DAHDI_FLAGBIT_OPEN never
gets set and module_put is never called on the exporter module.


====================================================================== 

---------------------------------------------------------------------- 
 (0129315) avarvit (reporter) - 2010-12-05 07:51
 https://issues.asterisk.org/view.php?id=18422#c129315 
---------------------------------------------------------------------- 
Hi sruffell,

Thanks for responding and for taking appropriate action. My
userid is avarvit, not avarit. I have now signed the license,
so I guess I am allowed to (re)post the patch without anyone
having to take it down for legal reasons. Here it is:

*** ../dahdi-base.c.org 2010-12-05 06:07:52.000000000 +0200
--- ../dahdi-base.c     2010-12-04 07:27:54.000000000 +0200
***************
*** 2710,2717 ****
                        if (chan->span) {
                                if (!try_module_get(chan->span->owner))
                                        res = -ENXIO;
!                               else if (chan->span->open)
                                        res = chan->span->open(chan);
                        }
                        if (!res) {
                                chan->file = file;
--- 2710,2722 ----
                        if (chan->span) {
                                if (!try_module_get(chan->span->owner))
                                        res = -ENXIO;
!                               else if (chan->span->open) {
                                        res = chan->span->open(chan);
+                                       /* avarvit */
+                                       if (res) {
+                                              
module_put(chan->span->owner);
+                                       }
+                               }
                        }
                        if (!res) {
                                chan->file = file; 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-12-05 07:51 avarvit        Note Added: 0129315                          
======================================================================




More information about the asterisk-bugs mailing list