Re: [PATCH v4] media: platform: mtk-mdp3: Add missing check and free for ida_alloc

From: AngeloGioacchino Del Regno
Date: Tue Feb 14 2023 - 05:11:15 EST


Il 09/02/23 14:52, Jiasheng Jiang ha scritto:
Add the check for the return value of the ida_alloc in order to avoid
NULL pointer dereference.
Moreover, free allocated "ctx->id" if mdp_m2m_open fails later in order
to avoid memory leak.

Fixes: 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 driver")
Signed-off-by: Jiasheng Jiang <jiasheng@xxxxxxxxxxx>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>