On Wed, 4 Sep 2024 15:53:35 +0200 Paolo Abeni wrote:
> +static int net_shaper_ctx_setup(const struct genl_info *info, int type,
> + struct net_shaper_nl_ctx *ctx)
> +{
> + struct net *ns = genl_info_net(info);
> + struct net_device *dev;
> + int ifindex;
> +
> + memset(ctx, 0, sizeof(*ctx));
Don't think you need to memset() this?
Patch 1 touches the relevant memset()s in the core.
> +static int net_shaper_generic_pre(struct genl_info *info, int type)
> +{
> + struct net_shaper_nl_ctx *ctx = (struct net_shaper_nl_ctx *)info->ctx;
> + int ret;
> +
> + BUILD_BUG_ON(sizeof(*ctx) > sizeof(info->ctx));
> +
> + ret = net_shaper_ctx_setup(info, type, ctx);
> + if (ret)
> + return ret;
> +
> + return 0;
There seems to be no extra code here at the end of the series so:
return net_shaper_ctx_setup(info, type, ctx);
With those nits addressed:
Reviewed-by: Jakub Kicinski <[email protected]>