[COMMON] smfc: fix prevent issue
authorSeungchul Kim <sc377.kim@samsung.com>
Wed, 8 Aug 2018 04:36:57 +0000 (13:36 +0900)
committerhskang <hs1218.kang@samsung.com>
Thu, 11 Oct 2018 01:58:44 +0000 (10:58 +0900)
CID 232745: Dereferencing null pointer
CID 234028: Using uninitialized value

Change-Id: I6048a3b013688d706ad46b6944102c88fb960bbb
Signed-off-by: Seungchul Kim <sc377.kim@samsung.com>
drivers/media/platform/exynos/smfc/smfc.c

index 141adac6198af5b58ee5a87f2a318f11cf309cbd..75bacb2d32ab9e432d4c7df7cb527d05c668b00e 100644 (file)
@@ -188,7 +188,6 @@ static int smfc_vb2_queue_setup(struct vb2_queue *vq, unsigned int *num_buffers,
                                struct device *alloc_devs[])
 {
        struct smfc_ctx *ctx = vb2_get_drv_priv(vq);
-       unsigned int i;
 
        if (!(ctx->flags & SMFC_CTX_COMPRESS) && (*num_buffers > 1)) {
                dev_info(ctx->smfc->dev,
@@ -205,7 +204,7 @@ static int smfc_vb2_queue_setup(struct vb2_queue *vq, unsigned int *num_buffers,
                 */
                sizes[0] = PAGE_SIZE;
                *num_planes = 1;
-               alloc_devs[i] = ctx->smfc->dev;
+               alloc_devs[0] = ctx->smfc->dev;
                if (!!(ctx->flags & SMFC_CTX_B2B_COMPRESS)) {
                        sizes[1] = PAGE_SIZE;
                        alloc_devs[1] = ctx->smfc->dev;