staging: sep: add missing misc_deregister() on error in sep_register_driver_with_fs()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 21 Oct 2013 05:33:50 +0000 (13:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 27 Oct 2013 13:29:48 +0000 (06:29 -0700)
Add the missing misc_deregister() before return from
sep_register_driver_with_fs() in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/sep/sep_main.c

index 11f5b211745758bb42dd6eb2190620282109ea1c..5f8c0a8ecb9d4b33f070867319c3e23638cfeeba 100644 (file)
@@ -4075,6 +4075,7 @@ static int sep_register_driver_with_fs(struct sep_device *sep)
        if (ret_val) {
                dev_warn(&sep->pdev->dev, "sysfs attribute1 fails for SEP %x\n",
                        ret_val);
+               misc_deregister(&sep->miscdev_sep);
                return ret_val;
        }