# Re: \[PATCH v6 net-next 03/15\] net-shapers: implement NL get operation

- From: Jakub Kicinski \<kuba@kernel.org\>
- Date: 2024-09-05 01:11:30 
- List: netdev
- Page: https://ratatoskr.run/netdev/2024/09/11305462
- Thread: https://ratatoskr.run/netdev/2024/09/11305393/t.md

```text
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 <kuba@kernel.org>
```
