• Laurent Pinchart's avatar
    [media] v4l: vsp1: Fix crash when resetting pipeline · d69e40fa
    Laurent Pinchart authored
    The vsp1_pipeline_reset() function loops over pipeline inputs and output
    and resets them. When doing so it assumes both that the pipeline has
    been correctly configured with an output, and that inputs are are stored
    in the pipe inputs array at positions 0 to num_inputs-1.
    
    Both the assumptions are incorrect. The pipeline might need to be reset
    after a failed attempts to configure it, without any output specified.
    Furthermore, inputs are stored in a positiong equal to their RPF index,
    possibly creating holes in the inputs array if the RPFs are not used in
    sequence.
    
    Fix both issues by looping over the whole inputs array and skipping
    unused entries, and ignoring the output when not set.
    
    Fixes: ff7e97c9 ("[media] v4l: vsp1: Store pipeline pointer in rwpf")
    Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
    d69e40fa
vsp1_pipe.c 12.3 KB