Patch "media: hantro: Check whether reset op is defined before use" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    media: hantro: Check whether reset op is defined before use

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     media-hantro-check-whether-reset-op-is-defined-befor.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 3bf344e2d9419d1e29c6de3919bf245479b7dd37
Author: Marek Vasut <marex@xxxxxxx>
Date:   Thu Aug 24 03:38:58 2023 +0200

    media: hantro: Check whether reset op is defined before use
    
    [ Upstream commit 88d4b23a629ebd34f682f770cb6c2116c851f7b8 ]
    
    The i.MX8MM/N/P does not define the .reset op since reset of the VPU is
    done by genpd. Check whether the .reset op is defined before calling it
    to avoid NULL pointer dereference.
    
    Note that the Fixes tag is set to the commit which removed the reset op
    from i.MX8M Hantro G2 implementation, this is because before this commit
    all the implementations did define the .reset op.
    
    Fixes: 6971efb70ac3 ("media: hantro: Allow i.MX8MQ G1 and G2 to run independently")
    Signed-off-by: Marek Vasut <marex@xxxxxxx>
    Reviewed-by: Chen-Yu Tsai <wenst@xxxxxxxxxxxx>
    Tested-by: Chen-Yu Tsai <wenst@xxxxxxxxxxxx>
    Reviewed-by: Adam Ford <aford173@xxxxxxxxx>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
index 8cb4a68c9119e..08840ba313e7a 100644
--- a/drivers/media/platform/verisilicon/hantro_drv.c
+++ b/drivers/media/platform/verisilicon/hantro_drv.c
@@ -125,7 +125,8 @@ void hantro_watchdog(struct work_struct *work)
 	ctx = v4l2_m2m_get_curr_priv(vpu->m2m_dev);
 	if (ctx) {
 		vpu_err("frame processing timed out!\n");
-		ctx->codec_ops->reset(ctx);
+		if (ctx->codec_ops->reset)
+			ctx->codec_ops->reset(ctx);
 		hantro_job_finish(vpu, ctx, VB2_BUF_STATE_ERROR);
 	}
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux