]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: imx: vdic: Restore default case to prepare_vdi_in_buffers()
authorSteve Longerbeam <slongerbeam@gmail.com>
Wed, 20 Feb 2019 01:09:38 +0000 (20:09 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:43:53 +0000 (06:43 -0700)
[ Upstream commit ce3c2433b074eb9d569a0f63a15d6fd5dbc87f02 ]

Restore a default case to prepare_vdi_in_buffers() to fix the following
smatch errors:

drivers/staging/media/imx/imx-media-vdic.c:236 prepare_vdi_in_buffers() error: uninitialized symbol 'prev_phys'.
drivers/staging/media/imx/imx-media-vdic.c:237 prepare_vdi_in_buffers() error: uninitialized symbol 'curr_phys'.
drivers/staging/media/imx/imx-media-vdic.c:238 prepare_vdi_in_buffers() error: uninitialized symbol 'next_phys'.

Fixes: 6e537b58de772 ("media: imx: vdic: rely on VDIC for correct field order")
Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/media/imx/imx-media-vdic.c

index 8a9af4688fd4167546766f5d3d34af3e70aa01f0..8cdd3daa6c5f028dbaf7a075393d6cf4c50ff091 100644 (file)
@@ -231,6 +231,12 @@ static void __maybe_unused prepare_vdi_in_buffers(struct vdic_priv *priv,
                curr_phys = vb2_dma_contig_plane_dma_addr(curr_vb, 0);
                next_phys = vb2_dma_contig_plane_dma_addr(curr_vb, 0) + is;
                break;
+       default:
+               /*
+                * can't get here, priv->fieldtype can only be one of
+                * the above. This is to quiet smatch errors.
+                */
+               return;
        }
 
        ipu_cpmem_set_buffer(priv->vdi_in_ch_p, 0, prev_phys);