Commit 7ae740df authored by Michał Mirosław's avatar Michał Mirosław Committed by David S. Miller

netlabel: Use genl_register_family_with_ops()

Use genl_register_family_with_ops() instead of a copy. This fixes genetlink
family leak on error path.
Signed-off-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8f698d54
......@@ -785,18 +785,6 @@ static struct genl_ops netlbl_cipsov4_ops[] = {
*/
int __init netlbl_cipsov4_genl_init(void)
{
int ret_val, i;
ret_val = genl_register_family(&netlbl_cipsov4_gnl_family);
if (ret_val != 0)
return ret_val;
for (i = 0; i < ARRAY_SIZE(netlbl_cipsov4_ops); i++) {
ret_val = genl_register_ops(&netlbl_cipsov4_gnl_family,
&netlbl_cipsov4_ops[i]);
if (ret_val != 0)
return ret_val;
}
return 0;
return genl_register_family_with_ops(&netlbl_cipsov4_gnl_family,
netlbl_cipsov4_ops, ARRAY_SIZE(netlbl_cipsov4_ops));
}
......@@ -779,18 +779,6 @@ static struct genl_ops netlbl_mgmt_genl_ops[] = {
*/
int __init netlbl_mgmt_genl_init(void)
{
int ret_val, i;
ret_val = genl_register_family(&netlbl_mgmt_gnl_family);
if (ret_val != 0)
return ret_val;
for (i = 0; i < ARRAY_SIZE(netlbl_mgmt_genl_ops); i++) {
ret_val = genl_register_ops(&netlbl_mgmt_gnl_family,
&netlbl_mgmt_genl_ops[i]);
if (ret_val != 0)
return ret_val;
}
return 0;
return genl_register_family_with_ops(&netlbl_mgmt_gnl_family,
netlbl_mgmt_genl_ops, ARRAY_SIZE(netlbl_mgmt_genl_ops));
}
......@@ -1478,20 +1478,8 @@ static struct genl_ops netlbl_unlabel_genl_ops[] = {
*/
int __init netlbl_unlabel_genl_init(void)
{
int ret_val, i;
ret_val = genl_register_family(&netlbl_unlabel_gnl_family);
if (ret_val != 0)
return ret_val;
for (i = 0; i < ARRAY_SIZE(netlbl_unlabel_genl_ops); i++) {
ret_val = genl_register_ops(&netlbl_unlabel_gnl_family,
&netlbl_unlabel_genl_ops[i]);
if (ret_val != 0)
return ret_val;
}
return 0;
return genl_register_family_with_ops(&netlbl_unlabel_gnl_family,
netlbl_unlabel_genl_ops, ARRAY_SIZE(netlbl_unlabel_genl_ops));
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment