[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e442c69e-5257-413e-9f3e-490aa5e37378@kernel.org>
Date: Mon, 5 Jan 2026 08:07:53 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Chen Changcheng <chenchangcheng@...inos.cn>,
laurent.pinchart@...asonboard.com, hansg@...nel.org, mchehab@...nel.org
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] media: uvcvideo: Use scope-based cleanup helper
On 05/01/2026 01:56, Chen Changcheng wrote:
> Replace the manual kfree() with __free(kfree) annotation for data
> references. This aligns the code with the latest kernel style.
>
> No functional change intended.
>
> Signed-off-by: Chen Changcheng <chenchangcheng@...inos.cn>
> ---
> drivers/media/usb/uvc/uvc_video.c | 23 ++++++++---------------
> 1 file changed, 8 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
> index 2094e059d7d3..0f524c014d62 100644
> --- a/drivers/media/usb/uvc/uvc_video.c
> +++ b/drivers/media/usb/uvc/uvc_video.c
> @@ -291,7 +291,7 @@ static int uvc_get_video_ctrl(struct uvc_streaming *stream,
> struct uvc_streaming_control *ctrl, int probe, u8 query)
> {
> u16 size = uvc_video_ctrl_size(stream);
> - u8 *data;
> + u8 *data __free(kfree) = NULL;
This is an undesired syntax explicitly documented as one to avoid. You
need here proper assignment, not NULL. Please don't use cleanup.h if you
do not intend to follow it because it does not make the code simpler.
Best regards,
Krzysztof
Powered by blists - more mailing lists