[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2df5ac80-5db6-4b8f-ab5b-b8b89237777f@kernel.org>
Date: Sat, 29 Nov 2025 15:08:03 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Tariq Toukan <tariqt@...dia.com>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller" <davem@...emloft.net>
Cc: Donald Hunter <donald.hunter@...il.com>, Jiri Pirko <jiri@...nulli.us>,
Jonathan Corbet <corbet@....net>, Saeed Mahameed <saeedm@...dia.com>,
Leon Romanovsky <leon@...nel.org>, Mark Bloch <mbloch@...dia.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, linux-rdma@...r.kernel.org,
Gal Pressman <gal@...dia.com>, Moshe Shemesh <moshe@...dia.com>,
Carolina Jubran <cjubran@...dia.com>, Cosmin Ratiu <cratiu@...dia.com>,
Jiri Pirko <jiri@...dia.com>, Randy Dunlap <rdunlap@...radead.org>
Subject: Re: [PATCH net-next V4 09/14] net/mlx5: Introduce shared devlink
instance for PFs on same chip
On 25/11/2025 21:06, Tariq Toukan wrote:
> +
> +static void mlx5_shd_destroy(struct mlx5_shd *shd)
> +{
> + list_del(&shd->list);
> + kfree(shd->sn);
> + faux_device_destroy(shd->faux_dev);
> +}
> +
> +int mlx5_shd_init(struct mlx5_core_dev *dev)
> +{
> + u8 *vpd_data __free(kfree) = NULL;
This is undesired syntax explicitly documented as one to avoid. Please
don't use cleanup.h if you do not intend to follow it.
Plus netdev dislikes cleanup, that's another point.
> + struct pci_dev *pdev = dev->pdev;
> + unsigned int vpd_size, kw_len;
> + struct mlx5_shd *shd;
> + const char *sn;
> + char *end;
> + int start;
> + int err;
> +
> + if (!mlx5_core_is_pf(dev))
> + return 0;
> +
> + vpd_data = pci_vpd_alloc(pdev, &vpd_size);
Here....
> + if (IS_ERR(vpd_data)) {
> + err = PTR_ERR(vpd_data);
> + return err == -ENODEV ? 0 : err;
And here you kfree(IS_ERR).
This is either buggy code or very confusing. Please do not use cleanup.h
if to intend not to read it.
Best regards,
Krzysztof
Powered by blists - more mailing lists