summaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/rtlx-cmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/rtlx-cmp.c')
-rw-r--r--arch/mips/kernel/rtlx-cmp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/mips/kernel/rtlx-cmp.c b/arch/mips/kernel/rtlx-cmp.c
index 758fb3cd2326..d26dcc4b46e7 100644
--- a/arch/mips/kernel/rtlx-cmp.c
+++ b/arch/mips/kernel/rtlx-cmp.c
@@ -77,6 +77,9 @@ int __init rtlx_module_init(void)
dev = device_create(mt_class, NULL, MKDEV(major, i), NULL,
"%s%d", RTLX_MODULE_NAME, i);
if (IS_ERR(dev)) {
+ while (i--)
+ device_destroy(mt_class, MKDEV(major, i));
+
err = PTR_ERR(dev);
goto out_chrdev;
}