media: mediatek: vcodec: Update mtk_vcodec_mem_free() error messages
authorFei Shao <fshao@chromium.org>
Thu, 21 Dec 2023 09:17:45 +0000 (09:17 +0000)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 26 Apr 2024 10:57:47 +0000 (11:57 +0100)
commitf19a771ac1e8d762e8a835fad150d7fceffd65c7
treeb31c2992621826e848621425591e85f6e3f2cac7
parent3de2a2184d4407b9199b2d3b69a7958e77e9f6f9
media: mediatek: vcodec: Update mtk_vcodec_mem_free() error messages

In mtk_vcodec_mem_free(), there are two cases where a NULL VA is passed:
- mem->size == 0: we are called to free no memory. This may happen when
  we call mtk_vcodec_mem_free() twice or the memory has never been
  allocated.
- mem->size > 0: we are called to free memory but without VA. This means
  that we failed to free the memory for real.

Both cases are not expected to happen, and we want to have clearer error
messages to describe which one we just encountered.
Update the error messages to include more information for that purpose.

Signed-off-by: Fei Shao <fshao@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_util.c