Module: xenomai-jki
Branch: for-upstream
Commit: 8533bdf94108da73278cb6300cc15a1d8dde68cc
URL:    
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=8533bdf94108da73278cb6300cc15a1d8dde68cc

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Fri Aug 20 14:44:40 2010 +0200

RTDM: Properly clean up on xnvfile setup errors

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 ksrc/skins/rtdm/proc.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/ksrc/skins/rtdm/proc.c b/ksrc/skins/rtdm/proc.c
index cd6802c..f898608 100644
--- a/ksrc/skins/rtdm/proc.c
+++ b/ksrc/skins/rtdm/proc.c
@@ -403,25 +403,29 @@ int __init rtdm_proc_init(void)
        /* Initialise vfiles */
        ret = xnvfile_init_dir("rtdm", &rtdm_vfroot, &nkvfroot);
        if (ret)
-               return ret;
+               goto error;
 
        ret = xnvfile_init_regular("named_devices", &named_vfile, &rtdm_vfroot);
        if (ret)
-               return ret;
+               goto error;
 
        ret = xnvfile_init_regular("protocol_devices", &proto_vfile, 
&rtdm_vfroot);
        if (ret)
-               return ret;
+               goto error;
 
        ret = xnvfile_init_regular("open_fildes", &openfd_vfile, &rtdm_vfroot);
        if (ret)
-               return ret;
+               goto error;
 
        ret = xnvfile_init_regular("fildes", &allfd_vfile, &rtdm_vfroot);
        if (ret)
-               return ret;
+               goto error;
 
        return 0;
+
+error:
+       rtdm_proc_cleanup();
+       return ret;
 }
 
 void rtdm_proc_cleanup(void)


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to