From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
To: Felix Gu <ustc.gu@gmail.com>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Frank Li <Frank.Li@nxp.com>,
linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] i3c: master: renesas: Use __free(kfree) for xfer cleanup in renesas_i3c_send_ccc_cmd()
Date: Tue, 7 Apr 2026 10:11:39 +0200 [thread overview]
Message-ID: <adS8O_ymEIefZkva@tom-desktop> (raw)
In-Reply-To: <20260406-renesas-v3-2-4b724d7708f4@gmail.com>
Hi Felix,
Thanks for your patch.
On Mon, Apr 06, 2026 at 08:43:17PM +0800, Felix Gu wrote:
> Use __free(kfree) for automatic cleanup, matching the pattern already
> used in other functions in this driver.
>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Kind Regards,
Tommaso
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>
> ---
> drivers/i3c/master/renesas-i3c.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
> index a8a9e89a9710..f39c449922ca 100644
> --- a/drivers/i3c/master/renesas-i3c.c
> +++ b/drivers/i3c/master/renesas-i3c.c
> @@ -748,7 +748,6 @@ static int renesas_i3c_send_ccc_cmd(struct i3c_master_controller *m,
> struct i3c_ccc_cmd *ccc)
> {
> struct renesas_i3c *i3c = to_renesas_i3c(m);
> - struct renesas_i3c_xfer *xfer;
> struct renesas_i3c_cmd *cmd;
> int ret, pos = 0;
>
> @@ -758,7 +757,7 @@ static int renesas_i3c_send_ccc_cmd(struct i3c_master_controller *m,
> return pos;
> }
>
> - xfer = renesas_i3c_alloc_xfer(i3c, 1);
> + struct renesas_i3c_xfer *xfer __free(kfree) = renesas_i3c_alloc_xfer(i3c, 1);
> if (!xfer)
> return -ENOMEM;
>
> @@ -807,8 +806,6 @@ static int renesas_i3c_send_ccc_cmd(struct i3c_master_controller *m,
> if (ret)
> ccc->err = I3C_ERROR_M2;
>
> - kfree(xfer);
> -
> return ret;
> }
>
>
> --
> 2.43.0
>
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
next prev parent reply other threads:[~2026-04-07 8:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-06 12:43 [PATCH v3 0/2] i3c: master: renesas: Fix a memory leak and use __free(kfree) to simplify the code Felix Gu
2026-04-06 12:43 ` [PATCH v3 1/2] i3c: master: renesas: Fix memory leak in renesas_i3c_i3c_xfers() Felix Gu
2026-04-06 12:43 ` [PATCH v3 2/2] i3c: master: renesas: Use __free(kfree) for xfer cleanup in renesas_i3c_send_ccc_cmd() Felix Gu
2026-04-07 2:02 ` Frank Li
2026-04-07 8:11 ` Tommaso Merciai [this message]
2026-04-12 14:47 ` [PATCH v3 0/2] i3c: master: renesas: Fix a memory leak and use __free(kfree) to simplify the code Alexandre Belloni
2026-04-12 14:53 ` Alexandre Belloni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=adS8O_ymEIefZkva@tom-desktop \
--to=tommaso.merciai.xr@bp.renesas.com \
--cc=Frank.Li@nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ustc.gu@gmail.com \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.