Re: [PATCH 2/3 nf-next v2] netfilter: nfnetlink_osf: extract nfnetlink_subsystem code from xt_osf.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  static struct xt_match xt_osf_match = {
@@ -178,51 +66,23 @@ static struct xt_match xt_osf_match = {
  static int __init xt_osf_init(void)
  {
  	int err = -EINVAL;
-	int i;
-
-	for (i=0; i<ARRAY_SIZE(xt_osf_fingers); ++i)
-		INIT_LIST_HEAD(&xt_osf_fingers[i]);
-
-	err = nfnetlink_subsys_register(&xt_osf_nfnetlink);
-	if (err < 0) {
-		pr_err("Failed to register OSF nsfnetlink helper (%d)\n", err);
-		goto err_out_exit;
-	}
err = xt_register_match(&xt_osf_match);

You can just simplify this and so:

         return xt_register_match(...);


I think I cannot do "return xt_register_match(...);" because if it fails we need to print the error as it is already done. We can do "return err;" instead of "goto err_out;".

  	if (err) {
  		pr_err("Failed to register OS fingerprint "
  		       "matching module (%d)\n", err);
-		goto err_out_remove;
+		goto err_out;
  	}
return 0; -err_out_remove:
-	nfnetlink_subsys_unregister(&xt_osf_nfnetlink);
-err_out_exit:
+err_out:
  	return err;
  }
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux