]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Staging: comedi: comedi_fops: Avoid orphaned proc entry
authorCheah Kok Cheong <thrust73@gmail.com>
Thu, 3 Aug 2017 12:14:41 +0000 (13:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 1 Nov 2017 21:12:41 +0000 (22:12 +0100)
commit bf279ece37d2a3eaaa9813fcd7a1d8a81eb29c20 upstream.

Move comedi_proc_init to the end to avoid orphaned proc entry
if module loading failed.

Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/staging/comedi/comedi_fops.c

index 0ae406a475073cbcf9366256a226c4b3d8c3ce60..57457011ded39d2687fddf1816d40bed8838cb43 100644 (file)
@@ -2557,9 +2557,6 @@ static int __init comedi_init(void)
 
        comedi_class->dev_attrs = comedi_dev_attrs;
 
-       /* XXX requires /proc interface */
-       comedi_proc_init();
-
        /* create devices files for legacy/manual use */
        for (i = 0; i < comedi_num_legacy_minors; i++) {
                struct comedi_device *dev;
@@ -2576,6 +2573,9 @@ static int __init comedi_init(void)
                }
        }
 
+       /* XXX requires /proc interface */
+       comedi_proc_init();
+
        return 0;
 }
 module_init(comedi_init);