Skip to content

Commit

Permalink
staging: dgrp: remove redundant NULL check before unregister_dgrp_dev…
Browse files Browse the repository at this point in the history
…ice().

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>
  • Loading branch information
Cyril Roelandt authored and Greg Kroah-Hartman committed Feb 13, 2013
1 parent 76426da commit ae87d63
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/staging/dgrp/dgrp_specproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit ae87d63

Please sign in to comment.