lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1401346448-17105-1-git-send-email-crquan@gmail.com>
Date:	Wed, 28 May 2014 23:54:08 -0700
From:	Cheng Renquan <crquan@...il.com>
To:	"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Cc:	Johannes Berg <johannes.berg@...el.com>
Subject: [PATCH] genetlink: remove superfluous assignment

the local variable ops and n_ops were just read out from family,
and not changed, why need to assign back?

Validation functions should operate on const parameters and not
change anything.

Signed-off-by: Cheng Renquan <crquan@...il.com>

---
 net/netlink/genetlink.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Index: linux-3.14.3/net/netlink/genetlink.c
===================================================================
--- linux-3.14.3.orig/net/netlink/genetlink.c	2014-05-06 07:59:58.000000000 -0700
+++ linux-3.14.3/net/netlink/genetlink.c	2014-05-28 23:42:46.325410152 -0700
@@ -307,39 +307,35 @@
 		genl_ctrl_event(CTRL_CMD_DELMCAST_GRP, family,
 				&family->mcgrps[i], grp_id);
 	}
 }
 
-static int genl_validate_ops(struct genl_family *family)
+static int genl_validate_ops(const struct genl_family *family)
 {
 	const struct genl_ops *ops = family->ops;
 	unsigned int n_ops = family->n_ops;
 	int i, j;
 
 	if (WARN_ON(n_ops && !ops))
 		return -EINVAL;
 
 	if (!n_ops)
 		return 0;
 
 	for (i = 0; i < n_ops; i++) {
 		if (ops[i].dumpit == NULL && ops[i].doit == NULL)
 			return -EINVAL;
 		for (j = i + 1; j < n_ops; j++)
 			if (ops[i].cmd == ops[j].cmd)
 				return -EINVAL;
 	}
 
-	/* family is not registered yet, so no locking needed */
-	family->ops = ops;
-	family->n_ops = n_ops;
-
 	return 0;
 }
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ