]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ALSA: hda: Delete an unnecessary check before the function call "kobject_put"
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 8 Jul 2015 19:26:02 +0000 (21:26 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 9 Jul 2015 12:20:27 +0000 (14:20 +0200)
The kobject_put() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/hda/hdac_sysfs.c

index 0a6ce3b84cc474acb96ef435d02d7a7dfd926b42..089b35f6f1086e0081262927acb84866fe845e0b 100644 (file)
@@ -321,8 +321,7 @@ static void widget_tree_free(struct hdac_device *codec)
                        free_widget_node(*p, &widget_node_group);
                kfree(tree->nodes);
        }
-       if (tree->root)
-               kobject_put(tree->root);
+       kobject_put(tree->root);
        kfree(tree);
        codec->widgets = NULL;
 }