diff --git a/home/nipa/nipa_out/953276/ynl/old-code/dpll-user.c b/home/nipa/nipa_out/953276/ynl/new-code/dpll-user.c index cdc58aad33e4..3fad51752650 100644 --- a/home/nipa/nipa_out/953276/ynl/old-code/dpll-user.c +++ b/home/nipa/nipa_out/953276/ynl/new-code/dpll-user.c @@ -1085,6 +1085,7 @@ int dpll_pin_set(struct ynl_sock *ys, struct dpll_pin_set_req *req) { struct ynl_req_state yrs = { .yarg = { .ys = ys, }, }; struct nlmsghdr *nlh; + unsigned int i; int err; nlh = ynl_gemsg_start_req(ys, ys->family_id, DPLL_CMD_PIN_SET, 1); @@ -1100,9 +1101,9 @@ int dpll_pin_set(struct ynl_sock *ys, struct dpll_pin_set_req *req) ynl_attr_put_u32(nlh, DPLL_A_PIN_PRIO, req->prio); if (req->_present.state) ynl_attr_put_u32(nlh, DPLL_A_PIN_STATE, req->state); - for (unsigned int i = 0; i < req->n_parent_device; i++) + for (i = 0; i < req->n_parent_device; i++) dpll_pin_parent_device_put(nlh, DPLL_A_PIN_PARENT_DEVICE, &req->parent_device[i]); - for (unsigned int i = 0; i < req->n_parent_pin; i++) + for (i = 0; i < req->n_parent_pin; i++) dpll_pin_parent_pin_put(nlh, DPLL_A_PIN_PARENT_PIN, &req->parent_pin[i]); if (req->_present.phase_adjust) ynl_attr_put_s32(nlh, DPLL_A_PIN_PHASE_ADJUST, req->phase_adjust); diff --git a/home/nipa/nipa_out/953276/ynl/old-code/dpll-user.h b/home/nipa/nipa_out/953276/ynl/new-code/dpll-user.h index e94cc10f41a4..70ee0d5662c5 100644 --- a/home/nipa/nipa_out/953276/ynl/old-code/dpll-user.h +++ b/home/nipa/nipa_out/953276/ynl/new-code/dpll-user.h @@ -54,6 +54,8 @@ struct dpll_pin_parent_device { __s64 phase_offset; }; +void dpll_pin_parent_device_free(struct dpll_pin_parent_device *obj); + struct dpll_pin_parent_pin { struct { __u32 parent_id:1; @@ -64,6 +66,8 @@ struct dpll_pin_parent_pin { enum dpll_pin_state state; }; +void dpll_pin_parent_pin_free(struct dpll_pin_parent_pin *obj); + /* ============== DPLL_CMD_DEVICE_ID_GET ============== */ /* DPLL_CMD_DEVICE_ID_GET - do */ struct dpll_device_id_get_req { @@ -519,6 +523,10 @@ __dpll_pin_set_req_set_parent_device(struct dpll_pin_set_req *req, struct dpll_pin_parent_device *parent_device, unsigned int n_parent_device) { + unsigned int i; + + for (i = 0; i < req->n_parent_device; i++) + dpll_pin_parent_device_free(&req->parent_device[i]); free(req->parent_device); req->parent_device = parent_device; req->n_parent_device = n_parent_device; @@ -528,6 +536,10 @@ __dpll_pin_set_req_set_parent_pin(struct dpll_pin_set_req *req, struct dpll_pin_parent_pin *parent_pin, unsigned int n_parent_pin) { + unsigned int i; + + for (i = 0; i < req->n_parent_pin; i++) + dpll_pin_parent_pin_free(&req->parent_pin[i]); free(req->parent_pin); req->parent_pin = parent_pin; req->n_parent_pin = n_parent_pin; diff --git a/home/nipa/nipa_out/953276/ynl/old-code/ethtool-user.c b/home/nipa/nipa_out/953276/ynl/new-code/ethtool-user.c index dd23ea6dbe1e..72ccc16eae19 100644 --- a/home/nipa/nipa_out/953276/ynl/old-code/ethtool-user.c +++ b/home/nipa/nipa_out/953276/ynl/new-code/ethtool-user.c @@ -1530,9 +1530,10 @@ int ethtool_profile_put(struct nlmsghdr *nlh, unsigned int attr_type, struct ethtool_profile *obj) { struct nlattr *nest; + unsigned int i; nest = ynl_attr_nest_start(nlh, attr_type); - for (unsigned int i = 0; i < obj->n_irq_moderation; i++) + for (i = 0; i < obj->n_irq_moderation; i++) ethtool_irq_moderation_put(nlh, ETHTOOL_A_PROFILE_IRQ_MODERATION, &obj->irq_moderation[i]); ynl_attr_nest_end(nlh, nest); @@ -1634,9 +1635,10 @@ int ethtool_bitset_bits_put(struct nlmsghdr *nlh, unsigned int attr_type, struct ethtool_bitset_bits *obj) { struct nlattr *nest; + unsigned int i; nest = ynl_attr_nest_start(nlh, attr_type); - for (unsigned int i = 0; i < obj->n_bit; i++) + for (i = 0; i < obj->n_bit; i++) ethtool_bitset_bit_put(nlh, ETHTOOL_A_BITSET_BITS_BIT, &obj->bit[i]); ynl_attr_nest_end(nlh, nest); @@ -1696,9 +1698,10 @@ int ethtool_strings_put(struct nlmsghdr *nlh, unsigned int attr_type, struct ethtool_strings *obj) { struct nlattr *nest; + unsigned int i; nest = ynl_attr_nest_start(nlh, attr_type); - for (unsigned int i = 0; i < obj->n_string; i++) + for (i = 0; i < obj->n_string; i++) ethtool_string_put(nlh, ETHTOOL_A_STRINGS_STRING, &obj->string[i]); ynl_attr_nest_end(nlh, nest); @@ -1842,13 +1845,14 @@ int ethtool_stringset_put(struct nlmsghdr *nlh, unsigned int attr_type, struct ethtool_stringset_ *obj) { struct nlattr *nest; + unsigned int i; nest = ynl_attr_nest_start(nlh, attr_type); if (obj->_present.id) ynl_attr_put_u32(nlh, ETHTOOL_A_STRINGSET_ID, obj->id); if (obj->_present.count) ynl_attr_put_u32(nlh, ETHTOOL_A_STRINGSET_COUNT, obj->count); - for (unsigned int i = 0; i < obj->n_strings; i++) + for (i = 0; i < obj->n_strings; i++) ethtool_strings_put(nlh, ETHTOOL_A_STRINGSET_STRINGS, &obj->strings[i]); ynl_attr_nest_end(nlh, nest); @@ -1982,9 +1986,10 @@ int ethtool_stringsets_put(struct nlmsghdr *nlh, unsigned int attr_type, struct ethtool_stringsets *obj) { struct nlattr *nest; + unsigned int i; nest = ynl_attr_nest_start(nlh, attr_type); - for (unsigned int i = 0; i < obj->n_stringset; i++) + for (i = 0; i < obj->n_stringset; i++) ethtool_stringset_put(nlh, ETHTOOL_A_STRINGSETS_STRINGSET, &obj->stringset[i]); ynl_attr_nest_end(nlh, nest); diff --git a/home/nipa/nipa_out/953276/ynl/old-code/ethtool-user.h b/home/nipa/nipa_out/953276/ynl/new-code/ethtool-user.h index a1f62ee5bdac..dae56d1efe3a 100644 --- a/home/nipa/nipa_out/953276/ynl/old-code/ethtool-user.h +++ b/home/nipa/nipa_out/953276/ynl/new-code/ethtool-user.h @@ -144,6 +144,8 @@ struct ethtool_irq_moderation { __u32 comps; }; +void ethtool_irq_moderation_free(struct ethtool_irq_moderation *obj); + struct ethtool_cable_result { struct { __u32 pair:1; @@ -179,6 +181,8 @@ struct ethtool_bitset_bit { char *name; }; +void ethtool_bitset_bit_free(struct ethtool_bitset_bit *obj); + struct ethtool_tunnel_udp_entry { struct { __u32 port:1; @@ -199,6 +203,8 @@ struct ethtool_string { char *value; }; +void ethtool_string_free(struct ethtool_string *obj); + struct ethtool_profile { unsigned int n_irq_moderation; struct ethtool_irq_moderation *irq_moderation; @@ -224,6 +230,8 @@ struct ethtool_strings { struct ethtool_string *string; }; +void ethtool_strings_free(struct ethtool_strings *obj); + struct ethtool_bitset { struct { __u32 nomask:1; @@ -251,6 +259,8 @@ struct ethtool_stringset_ { struct ethtool_strings *strings; }; +void ethtool_stringset_free(struct ethtool_stringset_ *obj); + struct ethtool_tunnel_udp_table { struct { __u32 size:1; @@ -335,7 +345,11 @@ __ethtool_strset_get_req_set_stringsets_stringset(struct ethtool_strset_get_req struct ethtool_stringset_ *stringset, unsigned int n_stringset) { + unsigned int i; + req->_present.stringsets = 1; + for (i = 0; i < req->stringsets.n_stringset; i++) + ethtool_stringset_free(&req->stringsets.stringset[i]); free(req->stringsets.stringset); req->stringsets.stringset = stringset; req->stringsets.n_stringset = n_stringset; @@ -423,7 +437,11 @@ __ethtool_strset_get_req_dump_set_stringsets_stringset(struct ethtool_strset_get struct ethtool_stringset_ *stringset, unsigned int n_stringset) { + unsigned int i; + req->_present.stringsets = 1; + for (i = 0; i < req->stringsets.n_stringset; i++) + ethtool_stringset_free(&req->stringsets.stringset[i]); free(req->stringsets.stringset); req->stringsets.stringset = stringset; req->stringsets.n_stringset = n_stringset; @@ -962,8 +980,12 @@ __ethtool_linkmodes_set_req_set_ours_bits_bit(struct ethtool_linkmodes_set_req * struct ethtool_bitset_bit *bit, unsigned int n_bit) { + unsigned int i; + req->_present.ours = 1; req->ours._present.bits = 1; + for (i = 0; i < req->ours.bits.n_bit; i++) + ethtool_bitset_bit_free(&req->ours.bits.bit[i]); free(req->ours.bits.bit); req->ours.bits.bit = bit; req->ours.bits.n_bit = n_bit; @@ -1007,8 +1029,12 @@ __ethtool_linkmodes_set_req_set_peer_bits_bit(struct ethtool_linkmodes_set_req * struct ethtool_bitset_bit *bit, unsigned int n_bit) { + unsigned int i; + req->_present.peer = 1; req->peer._present.bits = 1; + for (i = 0; i < req->peer.bits.n_bit; i++) + ethtool_bitset_bit_free(&req->peer.bits.bit[i]); free(req->peer.bits.bit); req->peer.bits.bit = bit; req->peer.bits.n_bit = n_bit; @@ -1444,8 +1470,12 @@ __ethtool_debug_set_req_set_msgmask_bits_bit(struct ethtool_debug_set_req *req, struct ethtool_bitset_bit *bit, unsigned int n_bit) { + unsigned int i; + req->_present.msgmask = 1; req->msgmask._present.bits = 1; + for (i = 0; i < req->msgmask.bits.n_bit; i++) + ethtool_bitset_bit_free(&req->msgmask.bits.bit[i]); free(req->msgmask.bits.bit); req->msgmask.bits.bit = bit; req->msgmask.bits.n_bit = n_bit; @@ -1694,8 +1724,12 @@ __ethtool_wol_set_req_set_modes_bits_bit(struct ethtool_wol_set_req *req, struct ethtool_bitset_bit *bit, unsigned int n_bit) { + unsigned int i; + req->_present.modes = 1; req->modes._present.bits = 1; + for (i = 0; i < req->modes.bits.n_bit; i++) + ethtool_bitset_bit_free(&req->modes.bits.bit[i]); free(req->modes.bits.bit); req->modes.bits.bit = bit; req->modes.bits.n_bit = n_bit; @@ -1966,8 +2000,12 @@ __ethtool_features_set_req_set_hw_bits_bit(struct ethtool_features_set_req *req, struct ethtool_bitset_bit *bit, unsigned int n_bit) { + unsigned int i; + req->_present.hw = 1; req->hw._present.bits = 1; + for (i = 0; i < req->hw.bits.n_bit; i++) + ethtool_bitset_bit_free(&req->hw.bits.bit[i]); free(req->hw.bits.bit); req->hw.bits.bit = bit; req->hw.bits.n_bit = n_bit; @@ -2011,8 +2049,12 @@ __ethtool_features_set_req_set_wanted_bits_bit(struct ethtool_features_set_req * struct ethtool_bitset_bit *bit, unsigned int n_bit) { + unsigned int i; + req->_present.wanted = 1; req->wanted._present.bits = 1; + for (i = 0; i < req->wanted.bits.n_bit; i++) + ethtool_bitset_bit_free(&req->wanted.bits.bit[i]); free(req->wanted.bits.bit); req->wanted.bits.bit = bit; req->wanted.bits.n_bit = n_bit; @@ -2056,8 +2098,12 @@ __ethtool_features_set_req_set_active_bits_bit(struct ethtool_features_set_req * struct ethtool_bitset_bit *bit, unsigned int n_bit) { + unsigned int i; + req->_present.active = 1; req->active._present.bits = 1; + for (i = 0; i < req->active.bits.n_bit; i++) + ethtool_bitset_bit_free(&req->active.bits.bit[i]); free(req->active.bits.bit); req->active.bits.bit = bit; req->active.bits.n_bit = n_bit; @@ -2101,8 +2147,12 @@ __ethtool_features_set_req_set_nochange_bits_bit(struct ethtool_features_set_req struct ethtool_bitset_bit *bit, unsigned int n_bit) { + unsigned int i; + req->_present.nochange = 1; req->nochange._present.bits = 1; + for (i = 0; i < req->nochange.bits.n_bit; i++) + ethtool_bitset_bit_free(&req->nochange.bits.bit[i]); free(req->nochange.bits.bit); req->nochange.bits.bit = bit; req->nochange.bits.n_bit = n_bit; @@ -2372,8 +2422,12 @@ __ethtool_privflags_set_req_set_flags_bits_bit(struct ethtool_privflags_set_req struct ethtool_bitset_bit *bit, unsigned int n_bit) { + unsigned int i; + req->_present.flags = 1; req->flags._present.bits = 1; + for (i = 0; i < req->flags.bits.n_bit; i++) + ethtool_bitset_bit_free(&req->flags.bits.bit[i]); free(req->flags.bits.bit); req->flags.bits.bit = bit; req->flags.bits.n_bit = n_bit; @@ -3586,7 +3640,11 @@ __ethtool_coalesce_set_req_set_rx_profile_irq_moderation(struct ethtool_coalesce struct ethtool_irq_moderation *irq_moderation, unsigned int n_irq_moderation) { + unsigned int i; + req->_present.rx_profile = 1; + for (i = 0; i < req->rx_profile.n_irq_moderation; i++) + ethtool_irq_moderation_free(&req->rx_profile.irq_moderation[i]); free(req->rx_profile.irq_moderation); req->rx_profile.irq_moderation = irq_moderation; req->rx_profile.n_irq_moderation = n_irq_moderation; @@ -3596,7 +3654,11 @@ __ethtool_coalesce_set_req_set_tx_profile_irq_moderation(struct ethtool_coalesce struct ethtool_irq_moderation *irq_moderation, unsigned int n_irq_moderation) { + unsigned int i; + req->_present.tx_profile = 1; + for (i = 0; i < req->tx_profile.n_irq_moderation; i++) + ethtool_irq_moderation_free(&req->tx_profile.irq_moderation[i]); free(req->tx_profile.irq_moderation); req->tx_profile.irq_moderation = irq_moderation; req->tx_profile.n_irq_moderation = n_irq_moderation; @@ -4104,8 +4166,12 @@ __ethtool_eee_set_req_set_modes_ours_bits_bit(struct ethtool_eee_set_req *req, struct ethtool_bitset_bit *bit, unsigned int n_bit) { + unsigned int i; + req->_present.modes_ours = 1; req->modes_ours._present.bits = 1; + for (i = 0; i < req->modes_ours.bits.n_bit; i++) + ethtool_bitset_bit_free(&req->modes_ours.bits.bit[i]); free(req->modes_ours.bits.bit); req->modes_ours.bits.bit = bit; req->modes_ours.bits.n_bit = n_bit; @@ -4149,8 +4215,12 @@ __ethtool_eee_set_req_set_modes_peer_bits_bit(struct ethtool_eee_set_req *req, struct ethtool_bitset_bit *bit, unsigned int n_bit) { + unsigned int i; + req->_present.modes_peer = 1; req->modes_peer._present.bits = 1; + for (i = 0; i < req->modes_peer.bits.n_bit; i++) + ethtool_bitset_bit_free(&req->modes_peer.bits.bit[i]); free(req->modes_peer.bits.bit); req->modes_peer.bits.bit = bit; req->modes_peer.bits.n_bit = n_bit; @@ -4868,8 +4938,12 @@ __ethtool_fec_set_req_set_modes_bits_bit(struct ethtool_fec_set_req *req, struct ethtool_bitset_bit *bit, unsigned int n_bit) { + unsigned int i; + req->_present.modes = 1; req->modes._present.bits = 1; + for (i = 0; i < req->modes.bits.n_bit; i++) + ethtool_bitset_bit_free(&req->modes.bits.bit[i]); free(req->modes.bits.bit); req->modes.bits.bit = bit; req->modes.bits.n_bit = n_bit; @@ -7019,8 +7093,12 @@ __ethtool_tsconfig_set_req_set_tx_types_bits_bit(struct ethtool_tsconfig_set_req struct ethtool_bitset_bit *bit, unsigned int n_bit) { + unsigned int i; + req->_present.tx_types = 1; req->tx_types._present.bits = 1; + for (i = 0; i < req->tx_types.bits.n_bit; i++) + ethtool_bitset_bit_free(&req->tx_types.bits.bit[i]); free(req->tx_types.bits.bit); req->tx_types.bits.bit = bit; req->tx_types.bits.n_bit = n_bit; @@ -7064,8 +7142,12 @@ __ethtool_tsconfig_set_req_set_rx_filters_bits_bit(struct ethtool_tsconfig_set_r struct ethtool_bitset_bit *bit, unsigned int n_bit) { + unsigned int i; + req->_present.rx_filters = 1; req->rx_filters._present.bits = 1; + for (i = 0; i < req->rx_filters.bits.n_bit; i++) + ethtool_bitset_bit_free(&req->rx_filters.bits.bit[i]); free(req->rx_filters.bits.bit); req->rx_filters.bits.bit = bit; req->rx_filters.bits.n_bit = n_bit; @@ -7109,8 +7191,12 @@ __ethtool_tsconfig_set_req_set_hwtstamp_flags_bits_bit(struct ethtool_tsconfig_s struct ethtool_bitset_bit *bit, unsigned int n_bit) { + unsigned int i; + req->_present.hwtstamp_flags = 1; req->hwtstamp_flags._present.bits = 1; + for (i = 0; i < req->hwtstamp_flags.bits.n_bit; i++) + ethtool_bitset_bit_free(&req->hwtstamp_flags.bits.bit[i]); free(req->hwtstamp_flags.bits.bit); req->hwtstamp_flags.bits.bit = bit; req->hwtstamp_flags.bits.n_bit = n_bit; diff --git a/home/nipa/nipa_out/953276/ynl/old-code/handshake-user.c b/home/nipa/nipa_out/953276/ynl/new-code/handshake-user.c index f86e77421b5b..1b2bb8d57c43 100644 --- a/home/nipa/nipa_out/953276/ynl/old-code/handshake-user.c +++ b/home/nipa/nipa_out/953276/ynl/new-code/handshake-user.c @@ -296,6 +296,7 @@ int handshake_done(struct ynl_sock *ys, struct handshake_done_req *req) { struct ynl_req_state yrs = { .yarg = { .ys = ys, }, }; struct nlmsghdr *nlh; + unsigned int i; int err; nlh = ynl_gemsg_start_req(ys, ys->family_id, HANDSHAKE_CMD_DONE, 1); @@ -305,7 +306,7 @@ int handshake_done(struct ynl_sock *ys, struct handshake_done_req *req) ynl_attr_put_u32(nlh, HANDSHAKE_A_DONE_STATUS, req->status); if (req->_present.sockfd) ynl_attr_put_s32(nlh, HANDSHAKE_A_DONE_SOCKFD, req->sockfd); - for (unsigned int i = 0; i < req->n_remote_auth; i++) + for (i = 0; i < req->n_remote_auth; i++) ynl_attr_put_u32(nlh, HANDSHAKE_A_DONE_REMOTE_AUTH, req->remote_auth[i]); err = ynl_exec(ys, nlh, &yrs); diff --git a/home/nipa/nipa_out/953276/ynl/old-code/net_shaper-user.c b/home/nipa/nipa_out/953276/ynl/new-code/net_shaper-user.c index a200c1a1ac4d..d541552fac92 100644 --- a/home/nipa/nipa_out/953276/ynl/old-code/net_shaper-user.c +++ b/home/nipa/nipa_out/953276/ynl/new-code/net_shaper-user.c @@ -478,6 +478,7 @@ net_shaper_group(struct ynl_sock *ys, struct net_shaper_group_req *req) struct ynl_req_state yrs = { .yarg = { .ys = ys, }, }; struct net_shaper_group_rsp *rsp; struct nlmsghdr *nlh; + unsigned int i; int err; nlh = ynl_gemsg_start_req(ys, ys->family_id, NET_SHAPER_CMD_GROUP, 1); @@ -502,7 +503,7 @@ net_shaper_group(struct ynl_sock *ys, struct net_shaper_group_req *req) ynl_attr_put_u32(nlh, NET_SHAPER_A_PRIORITY, req->priority); if (req->_present.weight) ynl_attr_put_u32(nlh, NET_SHAPER_A_WEIGHT, req->weight); - for (unsigned int i = 0; i < req->n_leaves; i++) + for (i = 0; i < req->n_leaves; i++) net_shaper_leaf_info_put(nlh, NET_SHAPER_A_LEAVES, &req->leaves[i]); rsp = calloc(1, sizeof(*rsp)); diff --git a/home/nipa/nipa_out/953276/ynl/old-code/net_shaper-user.h b/home/nipa/nipa_out/953276/ynl/new-code/net_shaper-user.h index 273d26324035..55fec76d7316 100644 --- a/home/nipa/nipa_out/953276/ynl/old-code/net_shaper-user.h +++ b/home/nipa/nipa_out/953276/ynl/new-code/net_shaper-user.h @@ -43,6 +43,8 @@ struct net_shaper_leaf_info { __u32 weight; }; +void net_shaper_leaf_info_free(struct net_shaper_leaf_info *obj); + /* ============== NET_SHAPER_CMD_GET ============== */ /* NET_SHAPER_CMD_GET - do */ struct net_shaper_get_req { @@ -419,6 +421,10 @@ __net_shaper_group_req_set_leaves(struct net_shaper_group_req *req, struct net_shaper_leaf_info *leaves, unsigned int n_leaves) { + unsigned int i; + + for (i = 0; i < req->n_leaves; i++) + net_shaper_leaf_info_free(&req->leaves[i]); free(req->leaves); req->leaves = leaves; req->n_leaves = n_leaves; diff --git a/home/nipa/nipa_out/953276/ynl/old-code/netdev-user.c b/home/nipa/nipa_out/953276/ynl/new-code/netdev-user.c index d1b9508ea8a0..075e110484bd 100644 --- a/home/nipa/nipa_out/953276/ynl/old-code/netdev-user.c +++ b/home/nipa/nipa_out/953276/ynl/new-code/netdev-user.c @@ -1274,6 +1274,7 @@ netdev_bind_rx(struct ynl_sock *ys, struct netdev_bind_rx_req *req) struct ynl_req_state yrs = { .yarg = { .ys = ys, }, }; struct netdev_bind_rx_rsp *rsp; struct nlmsghdr *nlh; + unsigned int i; int err; nlh = ynl_gemsg_start_req(ys, ys->family_id, NETDEV_CMD_BIND_RX, 1); @@ -1284,7 +1285,7 @@ netdev_bind_rx(struct ynl_sock *ys, struct netdev_bind_rx_req *req) ynl_attr_put_u32(nlh, NETDEV_A_DMABUF_IFINDEX, req->ifindex); if (req->_present.fd) ynl_attr_put_u32(nlh, NETDEV_A_DMABUF_FD, req->fd); - for (unsigned int i = 0; i < req->n_queues; i++) + for (i = 0; i < req->n_queues; i++) netdev_queue_id_put(nlh, NETDEV_A_DMABUF_QUEUES, &req->queues[i]); rsp = calloc(1, sizeof(*rsp)); diff --git a/home/nipa/nipa_out/953276/ynl/old-code/netdev-user.h b/home/nipa/nipa_out/953276/ynl/new-code/netdev-user.h index bb14a9c81982..22635a7b942f 100644 --- a/home/nipa/nipa_out/953276/ynl/old-code/netdev-user.h +++ b/home/nipa/nipa_out/953276/ynl/new-code/netdev-user.h @@ -50,6 +50,8 @@ struct netdev_queue_id { enum netdev_queue_type type; }; +void netdev_queue_id_free(struct netdev_queue_id *obj); + /* ============== NETDEV_CMD_DEV_GET ============== */ /* NETDEV_CMD_DEV_GET - do */ struct netdev_dev_get_req { @@ -574,6 +576,10 @@ __netdev_bind_rx_req_set_queues(struct netdev_bind_rx_req *req, struct netdev_queue_id *queues, unsigned int n_queues) { + unsigned int i; + + for (i = 0; i < req->n_queues; i++) + netdev_queue_id_free(&req->queues[i]); free(req->queues); req->queues = queues; req->n_queues = n_queues; diff --git a/home/nipa/nipa_out/953276/ynl/old-code/nfsd-user.c b/home/nipa/nipa_out/953276/ynl/new-code/nfsd-user.c index e82b2e1287a6..70d9b6345ba7 100644 --- a/home/nipa/nipa_out/953276/ynl/old-code/nfsd-user.c +++ b/home/nipa/nipa_out/953276/ynl/new-code/nfsd-user.c @@ -385,12 +385,13 @@ int nfsd_threads_set(struct ynl_sock *ys, struct nfsd_threads_set_req *req) { struct ynl_req_state yrs = { .yarg = { .ys = ys, }, }; struct nlmsghdr *nlh; + unsigned int i; int err; nlh = ynl_gemsg_start_req(ys, ys->family_id, NFSD_CMD_THREADS_SET, 1); ys->req_policy = &nfsd_server_nest; - for (unsigned int i = 0; i < req->n_threads; i++) + for (i = 0; i < req->n_threads; i++) ynl_attr_put_u32(nlh, NFSD_A_SERVER_THREADS, req->threads[i]); if (req->_present.gracetime) ynl_attr_put_u32(nlh, NFSD_A_SERVER_GRACETIME, req->gracetime); @@ -515,12 +516,13 @@ int nfsd_version_set(struct ynl_sock *ys, struct nfsd_version_set_req *req) { struct ynl_req_state yrs = { .yarg = { .ys = ys, }, }; struct nlmsghdr *nlh; + unsigned int i; int err; nlh = ynl_gemsg_start_req(ys, ys->family_id, NFSD_CMD_VERSION_SET, 1); ys->req_policy = &nfsd_server_proto_nest; - for (unsigned int i = 0; i < req->n_version; i++) + for (i = 0; i < req->n_version; i++) nfsd_version_put(nlh, NFSD_A_SERVER_PROTO_VERSION, &req->version[i]); err = ynl_exec(ys, nlh, &yrs); @@ -626,12 +628,13 @@ int nfsd_listener_set(struct ynl_sock *ys, struct nfsd_listener_set_req *req) { struct ynl_req_state yrs = { .yarg = { .ys = ys, }, }; struct nlmsghdr *nlh; + unsigned int i; int err; nlh = ynl_gemsg_start_req(ys, ys->family_id, NFSD_CMD_LISTENER_SET, 1); ys->req_policy = &nfsd_server_sock_nest; - for (unsigned int i = 0; i < req->n_addr; i++) + for (i = 0; i < req->n_addr; i++) nfsd_sock_put(nlh, NFSD_A_SERVER_SOCK_ADDR, &req->addr[i]); err = ynl_exec(ys, nlh, &yrs); diff --git a/home/nipa/nipa_out/953276/ynl/old-code/nfsd-user.h b/home/nipa/nipa_out/953276/ynl/new-code/nfsd-user.h index df568b15267d..bb8b07ff442f 100644 --- a/home/nipa/nipa_out/953276/ynl/old-code/nfsd-user.h +++ b/home/nipa/nipa_out/953276/ynl/new-code/nfsd-user.h @@ -30,6 +30,8 @@ struct nfsd_version { __u32 minor; }; +void nfsd_version_free(struct nfsd_version *obj); + struct nfsd_sock { struct { __u32 addr_len; @@ -40,6 +42,8 @@ struct nfsd_sock { char *transport_name; }; +void nfsd_sock_free(struct nfsd_sock *obj); + /* ============== NFSD_CMD_RPC_STATUS_GET ============== */ /* NFSD_CMD_RPC_STATUS_GET - dump */ struct nfsd_rpc_status_get_rsp_dump { @@ -187,6 +191,10 @@ __nfsd_version_set_req_set_version(struct nfsd_version_set_req *req, struct nfsd_version *version, unsigned int n_version) { + unsigned int i; + + for (i = 0; i < req->n_version; i++) + nfsd_version_free(&req->version[i]); free(req->version); req->version = version; req->n_version = n_version; @@ -229,6 +237,10 @@ static inline void __nfsd_listener_set_req_set_addr(struct nfsd_listener_set_req *req, struct nfsd_sock *addr, unsigned int n_addr) { + unsigned int i; + + for (i = 0; i < req->n_addr; i++) + nfsd_sock_free(&req->addr[i]); free(req->addr); req->addr = addr; req->n_addr = n_addr; diff --git a/home/nipa/nipa_out/953276/ynl/old-code/nl80211-user.c b/home/nipa/nipa_out/953276/ynl/new-code/nl80211-user.c index f0bd5fa24a4a..7e6f20a20cf0 100644 --- a/home/nipa/nipa_out/953276/ynl/old-code/nl80211-user.c +++ b/home/nipa/nipa_out/953276/ynl/new-code/nl80211-user.c @@ -1606,8 +1606,11 @@ int nl80211_if_combination_attributes_parse(struct ynl_parse_arg *yarg, const struct nlattr *attr2; attr_limits = attr; - ynl_attr_for_each_nested(attr2, attr) + ynl_attr_for_each_nested(attr2, attr) { + if (ynl_attr_validate(yarg, attr2)) + return YNL_PARSE_CB_ERROR; dst->n_limits++; + } } else if (type == NL80211_IFACE_COMB_MAXNUM) { if (ynl_attr_validate(yarg, attr)) return YNL_PARSE_CB_ERROR; @@ -1688,8 +1691,11 @@ int nl80211_sar_attributes_parse(struct ynl_parse_arg *yarg, const struct nlattr *attr2; attr_specs = attr; - ynl_attr_for_each_nested(attr2, attr) + ynl_attr_for_each_nested(attr2, attr) { + if (ynl_attr_validate(yarg, attr2)) + return YNL_PARSE_CB_ERROR; dst->n_specs++; + } } } @@ -1892,8 +1898,11 @@ int nl80211_frequency_attrs_parse(struct ynl_parse_arg *yarg, const struct nlattr *attr2; attr_wmm = attr; - ynl_attr_for_each_nested(attr2, attr) + ynl_attr_for_each_nested(attr2, attr) { + if (ynl_attr_validate(yarg, attr2)) + return YNL_PARSE_CB_ERROR; dst->n_wmm++; + } } else if (type == NL80211_FREQUENCY_ATTR_NO_HE) { unsigned int len; @@ -2101,14 +2110,20 @@ int nl80211_band_attrs_parse(struct ynl_parse_arg *yarg, const struct nlattr *attr2; attr_freqs = attr; - ynl_attr_for_each_nested(attr2, attr) + ynl_attr_for_each_nested(attr2, attr) { + if (ynl_attr_validate(yarg, attr2)) + return YNL_PARSE_CB_ERROR; dst->n_freqs++; + } } else if (type == NL80211_BAND_ATTR_RATES) { const struct nlattr *attr2; attr_rates = attr; - ynl_attr_for_each_nested(attr2, attr) + ynl_attr_for_each_nested(attr2, attr) { + if (ynl_attr_validate(yarg, attr2)) + return YNL_PARSE_CB_ERROR; dst->n_rates++; + } } else if (type == NL80211_BAND_ATTR_HT_MCS_SET) { unsigned int len; @@ -2153,8 +2168,11 @@ int nl80211_band_attrs_parse(struct ynl_parse_arg *yarg, const struct nlattr *attr2; attr_iftype_data = attr; - ynl_attr_for_each_nested(attr2, attr) + ynl_attr_for_each_nested(attr2, attr) { + if (ynl_attr_validate(yarg, attr2)) + return YNL_PARSE_CB_ERROR; dst->n_iftype_data++; + } } else if (type == NL80211_BAND_ATTR_EDMG_CHANNELS) { unsigned int len; @@ -2447,8 +2465,11 @@ int nl80211_get_wiphy_rsp_parse(const struct nlmsghdr *nlh, const struct nlattr *attr2; attr_interface_combinations = attr; - ynl_attr_for_each_nested(attr2, attr) + ynl_attr_for_each_nested(attr2, attr) { + if (ynl_attr_validate(yarg, attr2)) + return YNL_PARSE_CB_ERROR; dst->n_interface_combinations++; + } } else if (type == NL80211_ATTR_MAC) { unsigned int len; @@ -2568,8 +2589,11 @@ int nl80211_get_wiphy_rsp_parse(const struct nlmsghdr *nlh, const struct nlattr *attr2; attr_supported_commands = attr; - ynl_attr_for_each_nested(attr2, attr) + ynl_attr_for_each_nested(attr2, attr) { + if (ynl_attr_validate(yarg, attr2)) + return YNL_PARSE_CB_ERROR; dst->n_supported_commands++; + } } else if (type == NL80211_ATTR_SUPPORTED_IFTYPES) { if (ynl_attr_validate(yarg, attr)) return YNL_PARSE_CB_ERROR; @@ -2869,8 +2893,11 @@ int nl80211_get_wiphy_rsp_dump_parse(const struct nlmsghdr *nlh, const struct nlattr *attr2; attr_interface_combinations = attr; - ynl_attr_for_each_nested(attr2, attr) + ynl_attr_for_each_nested(attr2, attr) { + if (ynl_attr_validate(yarg, attr2)) + return YNL_PARSE_CB_ERROR; dst->n_interface_combinations++; + } } else if (type == NL80211_ATTR_MAC) { unsigned int len; @@ -2990,8 +3017,11 @@ int nl80211_get_wiphy_rsp_dump_parse(const struct nlmsghdr *nlh, const struct nlattr *attr2; attr_supported_commands = attr; - ynl_attr_for_each_nested(attr2, attr) + ynl_attr_for_each_nested(attr2, attr) { + if (ynl_attr_validate(yarg, attr2)) + return YNL_PARSE_CB_ERROR; dst->n_supported_commands++; + } } else if (type == NL80211_ATTR_SUPPORTED_IFTYPES) { if (ynl_attr_validate(yarg, attr)) return YNL_PARSE_CB_ERROR; diff --git a/home/nipa/nipa_out/953276/ynl/old-code/nlctrl-user.c b/home/nipa/nipa_out/953276/ynl/new-code/nlctrl-user.c index 18fe2f6edf23..a092df2e0b4e 100644 --- a/home/nipa/nipa_out/953276/ynl/old-code/nlctrl-user.c +++ b/home/nipa/nipa_out/953276/ynl/new-code/nlctrl-user.c @@ -385,14 +385,20 @@ int nlctrl_getfamily_rsp_parse(const struct nlmsghdr *nlh, const struct nlattr *attr2; attr_mcast_groups = attr; - ynl_attr_for_each_nested(attr2, attr) + ynl_attr_for_each_nested(attr2, attr) { + if (ynl_attr_validate(yarg, attr2)) + return YNL_PARSE_CB_ERROR; dst->n_mcast_groups++; + } } else if (type == CTRL_ATTR_OPS) { const struct nlattr *attr2; attr_ops = attr; - ynl_attr_for_each_nested(attr2, attr) + ynl_attr_for_each_nested(attr2, attr) { + if (ynl_attr_validate(yarg, attr2)) + return YNL_PARSE_CB_ERROR; dst->n_ops++; + } } else if (type == CTRL_ATTR_VERSION) { if (ynl_attr_validate(yarg, attr)) return YNL_PARSE_CB_ERROR;