Re: [PATCH 2/2] media: v4l: vsp1: Fix uif null pointer access

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

 



Hi Biju,

On 01/03/2021 12:08, Biju Das wrote:
> RZ/G2L SoC has no UIF. This patch fixes null pointer access, when UIF
> module is not used.
> 
> Fixes: 5e824f989e6e8("media: v4l: vsp1: Integrate DISCOM in display pipeline")
> Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> ---
>  drivers/media/platform/vsp1/vsp1_drm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c
> index f6d2f47a4058..06f74d410973 100644
> --- a/drivers/media/platform/vsp1/vsp1_drm.c
> +++ b/drivers/media/platform/vsp1/vsp1_drm.c
> @@ -462,9 +462,9 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1,


This looks like it complicates these conditionals more than we perhaps
need to.

What do you think about adding something above the block comment here?:

	if (!drm_pipe->uif)
		return 0;


>  	 * make sure it is present in the pipeline's list of entities if it
>  	 * wasn't already.
>  	 */
> -	if (!use_uif) {
> +	if (drm_pipe->uif && !use_uif) {
>  		drm_pipe->uif->pipe = NULL;
> -	} else if (!drm_pipe->uif->pipe) {
> +	} else if (drm_pipe->uif && !drm_pipe->uif->pipe) {>  		drm_pipe->uif->pipe = pipe;
>  		list_add_tail(&drm_pipe->uif->list_pipe, &pipe->entities);
>  	}
> 




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux