# Re: \[PATCH v2 4/7\] i2c: i2c-core-acpi: Add i2c\_acpi\_dev\_name()

- From: Wolfram Sang \<wsa@kernel.org\>
- Date: 2021-01-28 09:01:56 
- List: linux-i2c
- Page: https://ratatoskr.run/linux-i2c/2021/01/6250643
- Thread: https://ratatoskr.run/linux-acpi/2021/01/6237815/t/2.md

```text

> > There's a real danger of a memory leak, as the function name sounds very
> > similar to dev_name() or acpi_dev_name() and those don't allocate
> > memory. I'm not sure what a better name would be, but given that this
> > function is only used in patch 6/7 and not in the I2C subsystem itself,
> > I wonder if we should inline this kasprintf() call in the caller and
> > drop this patch.
> 
> IMO if this is a one-off usage, it's better to open-code it.

Sounds reasonable to me, too.

```

## Attachments

- [signature.asc](https://ratatoskr.run/linux-i2c/2021/01/6250643/attachment/0) (application/pgp-signature, 833 bytes)
