staging: dgap: Don't remove sysfs group we failed to create
authorMark Hounschell <markh@compro.net>
Tue, 4 Mar 2014 21:03:07 +0000 (16:03 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Mar 2014 22:14:36 +0000 (14:14 -0800)
We should not remove a sysfs group we failed to create

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgap/dgap.c

index 5dfce34794f1a060baed170a8606f5afe09ca582..85f85eb166e1f428068ef42f2fb13e11bdbc9a12 100644 (file)
@@ -6686,10 +6686,8 @@ static void dgap_create_tty_sysfs(struct un_t *un, struct device *c)
        int ret;
 
        ret = sysfs_create_group(&c->kobj, &dgap_tty_attribute_group);
-       if (ret) {
-               sysfs_remove_group(&c->kobj, &dgap_tty_attribute_group);
+       if (ret)
                return;
-       }
 
        dev_set_drvdata(c, un);