staging: dgrp: remove redundant NULL check before unregister_dgrp_device().
authorCyril Roelandt <tipecaml@gmail.com>
Tue, 12 Feb 2013 04:01:51 +0000 (05:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Feb 2013 16:46:48 +0000 (08:46 -0800)
unregister_dgrp_device on a NULL pointer is a no-op, so the NULL checks in
dgrp_remove_nd() can be removed.

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgrp/dgrp_specproc.c

index dfdaede71ff4214c2ac499bcd9effd65172cda0c..13c7ccf163c5070179c924ecc16a84ab0846bcd4 100644 (file)
@@ -777,14 +777,11 @@ static int dgrp_remove_nd(struct nd_struct *nd)
                dgrp_remove_node_class_sysfs_files(nd);
        }
 
-       if (nd->nd_mon_de)
-               unregister_dgrp_device(nd->nd_mon_de);
+       unregister_dgrp_device(nd->nd_mon_de);
 
-       if (nd->nd_ports_de)
-               unregister_dgrp_device(nd->nd_ports_de);
+       unregister_dgrp_device(nd->nd_ports_de);
 
-       if (nd->nd_dpa_de)
-               unregister_dgrp_device(nd->nd_dpa_de);
+       unregister_dgrp_device(nd->nd_dpa_de);
 
        dgrp_tty_uninit(nd);