Re: [PATCH v2] arcnet: Add NULL check in com20020pci_probe()
From: Simon Horman
Date: Wed Apr 02 2025 - 05:08:59 EST
On Tue, Apr 01, 2025 at 05:37:18PM +0200, Markus Elfring wrote:
> > devm_kasprintf() return NULL if memory allocation fails. Currently,
> …
> call? failed?
>
>
> > Add NULL check after devm_kasprintf() to prevent this issue.
>
> Please complete also the corresponding exception handling.
>
> Source code example for further inspiration:
> https://elixir.bootlin.com/linux/v6.14-rc6/source/drivers/net/arcnet/com20020-pci.c#L239-L244
>
> Thus I suggest to use another label like “e_nomem” for this purpose.
Ok, but surely the err_free_arcdev label can be reused for this purpose.