From: Sanjay Chitroda <sanjayembeddedse@gmail•com>
To: jic23@kernel•org, m.tretter@pengutronix•de, mchehab@kernel•org,
p.zabel@pengutronix•de, tiffany.lin@mediatek•com,
andrew-ct.chen@mediatek•com, yunfei.dong@mediatek•com,
matthias.bgg@gmail•com, angelogioacchino.delregno@collabora•com,
johan@kernel•org, elder@kernel•org, gregkh@linuxfoundation•org,
pure.logic@nexus-software•ie
Cc: dlechner@baylibre•com, nuno.sa@analog•com, andy@kernel•org,
kernel@pengutronix•de, kees@kernel•org,
nabijaczleweli@nabijaczleweli•xyz, marcelo.schmitt1@gmail•com,
maudspierings@gocontroll•com, hverkuil+cisco@kernel•org,
ribalda@chromium•org, straube.linux@gmail•com,
dan.carpenter@linaro•org, lukagejak5@gmail•com,
ethantidmore06@gmail•com, samasth.norway.ananda@oracle•com,
karanja99erick@gmail•com, s9430939@naver•com, tglx@kernel•org,
mingo@kernel•org, sun.jian.kdev@gmail•com, weibu@redadmin•org,
linux-iio@vger•kernel.org, linux-kernel@vger•kernel.org,
linux-media@vger•kernel.org,
linux-arm-kernel@lists•infradead.org,
linux-mediatek@lists•infradead.org, greybus-dev@lists•linaro.org,
linux-staging@lists•linux.dev, sanjayembeddedse@gmail•com,
skhan@linuxfoundation•org
Subject: [PATCH 4/7] media: mediatek: vcodec: simplify cleanup using __free
Date: Wed, 11 Mar 2026 01:35:10 +0530 [thread overview]
Message-ID: <20260310200513.2162018-5-sanjayembedded@gmail.com> (raw)
In-Reply-To: <20260310200513.2162018-1-sanjayembedded@gmail.com>
From: Sanjay Chitroda <sanjayembeddedse@gmail•com>
Replace manual cleanup logic with __free attribute from cleanup.h. This
removes explicit kfree() calls and simplifies the error handling paths.
No functional change intended for kmalloc().
Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail•com>
---
.../media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c
index 2da11521fc7b..3184939f793a 100644
--- a/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c
+++ b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c
@@ -96,7 +96,7 @@ static ssize_t mtk_vdec_dbgfs_read(struct file *filp, char __user *ubuf,
int total_len = 200 * (dbgfs->inst_count == 0 ? 1 : dbgfs->inst_count);
int used_len = 0, curr_len, ret;
bool dbgfs_index[MTK_VDEC_DBGFS_MAX] = {0};
- char *buf = kmalloc(total_len, GFP_KERNEL);
+ char *buf __free(kfree) = kmalloc(total_len, GFP_KERNEL);
if (!buf)
return -ENOMEM;
@@ -134,7 +134,6 @@ static ssize_t mtk_vdec_dbgfs_read(struct file *filp, char __user *ubuf,
mutex_unlock(&dbgfs->dbgfs_lock);
read_buffer:
ret = simple_read_from_buffer(ubuf, count, ppos, buf, used_len);
- kfree(buf);
return ret;
}
--
2.34.1
next prev parent reply other threads:[~2026-03-10 20:06 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 20:05 [PATCH 0/7] drivers: Simplify cleanup paths using __free Sanjay Chitroda
2026-03-10 20:05 ` [PATCH 1/7] staging: greybus: simplify cleanup " Sanjay Chitroda
2026-03-10 21:07 ` Andy Shevchenko
2026-03-11 6:51 ` Dan Carpenter
2026-03-11 7:06 ` Greg KH
2026-03-10 20:05 ` [PATCH 2/7] iio: ssp_sensors: " Sanjay Chitroda
2026-03-10 21:11 ` Andy Shevchenko
2026-03-10 20:05 ` [PATCH 3/7] iio: st_sensors: " Sanjay Chitroda
2026-03-11 0:04 ` David Lechner
2026-03-10 20:05 ` Sanjay Chitroda [this message]
2026-03-19 21:08 ` [PATCH 4/7] media: mediatek: vcodec: " Nicolas Dufresne
2026-03-10 20:05 ` [PATCH 5/7] media: chips-media: coda: " Sanjay Chitroda
2026-03-10 20:05 ` [PATCH 6/7] media: allegro: " Sanjay Chitroda
2026-03-10 20:05 ` [PATCH 7/7] staging: rtl8723bs: " Sanjay Chitroda
2026-03-10 21:42 ` Andrew Lunn
2026-03-11 6:45 ` Greg KH
2026-03-10 21:04 ` [PATCH 0/7] drivers: Simplify cleanup paths " Andy Shevchenko
2026-03-10 21:52 ` David Lechner
2026-03-11 1:57 ` Sanjay Chitroda
2026-03-11 5:42 ` Luka Gejak
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=20260310200513.2162018-5-sanjayembedded@gmail.com \
--to=sanjayembeddedse@gmail$(echo .)com \
--cc=andrew-ct.chen@mediatek$(echo .)com \
--cc=andy@kernel$(echo .)org \
--cc=angelogioacchino.delregno@collabora$(echo .)com \
--cc=dan.carpenter@linaro$(echo .)org \
--cc=dlechner@baylibre$(echo .)com \
--cc=elder@kernel$(echo .)org \
--cc=ethantidmore06@gmail$(echo .)com \
--cc=gregkh@linuxfoundation$(echo .)org \
--cc=greybus-dev@lists$(echo .)linaro.org \
--cc=hverkuil+cisco@kernel$(echo .)org \
--cc=jic23@kernel$(echo .)org \
--cc=johan@kernel$(echo .)org \
--cc=karanja99erick@gmail$(echo .)com \
--cc=kees@kernel$(echo .)org \
--cc=kernel@pengutronix$(echo .)de \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-iio@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-media@vger$(echo .)kernel.org \
--cc=linux-mediatek@lists$(echo .)infradead.org \
--cc=linux-staging@lists$(echo .)linux.dev \
--cc=lukagejak5@gmail$(echo .)com \
--cc=m.tretter@pengutronix$(echo .)de \
--cc=marcelo.schmitt1@gmail$(echo .)com \
--cc=matthias.bgg@gmail$(echo .)com \
--cc=maudspierings@gocontroll$(echo .)com \
--cc=mchehab@kernel$(echo .)org \
--cc=mingo@kernel$(echo .)org \
--cc=nabijaczleweli@nabijaczleweli$(echo .)xyz \
--cc=nuno.sa@analog$(echo .)com \
--cc=p.zabel@pengutronix$(echo .)de \
--cc=pure.logic@nexus-software$(echo .)ie \
--cc=ribalda@chromium$(echo .)org \
--cc=s9430939@naver$(echo .)com \
--cc=samasth.norway.ananda@oracle$(echo .)com \
--cc=skhan@linuxfoundation$(echo .)org \
--cc=straube.linux@gmail$(echo .)com \
--cc=sun.jian.kdev@gmail$(echo .)com \
--cc=tglx@kernel$(echo .)org \
--cc=tiffany.lin@mediatek$(echo .)com \
--cc=weibu@redadmin$(echo .)org \
--cc=yunfei.dong@mediatek$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox