[RAMEN9610-19845][9610] vipx: fix prevent defects
authorSanghwa Park <senius.park@samsung.com>
Tue, 10 Sep 2019 15:24:03 +0000 (00:24 +0900)
committerKim Gunho <gunho.kim@samsung.com>
Fri, 20 Sep 2019 10:29:54 +0000 (19:29 +0900)
  275134: Uninitialized scalar variable
  275231: Uninitialized scalar variable
  275245: Uninitialized pointer read
  275283: Uninitialized scalar variable
  275562: Uninitialized scalar variable
  275638: Uninitialized scalar variable

Change-Id: I12838a018382220052c9c8e99a3e79c8caa4699c
Signed-off-by: Sanghwa Park <senius.park@samsung.com>
Signed-off-by: Kim Gunho <gunho.kim@samsung.com>
drivers/vision/vipx/platform/exynos9610/vipx-ctrl-exynos9610.c
drivers/vision/vipx/vipx-memory.c
drivers/vision/vipx/vipx-queue.c
drivers/vision/vipx_vertex/vertex-queue.c

index 371c43a6c4d2395a1dd7175eb183764384357ad9..72733fda6edbce8a19408ebcd1c7a54d7328d2f1 100644 (file)
@@ -183,7 +183,7 @@ static int vipx_exynos9610_ctrl_clear_irq(struct vipx_system *sys,
                offset = regs_ss1[REG_SS1_IRQ_FROM_DEVICE].offset;
                writel(val, sys->reg_ss[REG_SS1] + offset);
        } else {
-               val = -EINVAL;
+               ret = -EINVAL;
                vipx_err("direction of irq is invalid (%d)\n", direction);
                goto p_err;
        }
index dd1b89ab396beab30541c7839710a859e624e3f5..dbab8131b1c549c421931ff02b1604081b1339bb 100644 (file)
@@ -278,9 +278,15 @@ static int __vipx_memory_alloc(struct vipx_memory *mem,
                }
                pmem->dvaddr = dvaddr;
        }
-       vipx_info("[%20s] memory is allocated(%#p,%#x,%zuKB)",
-                       pmem->name, kvaddr, (int)pmem->dvaddr,
-                       pmem->size / SZ_1K);
+
+       if (pmem->kmap)
+               vipx_info("[%20s] memory is allocated(%#p,%#x,%zuKB)",
+                               pmem->name, kvaddr, (int)pmem->dvaddr,
+                               pmem->size / SZ_1K);
+       else
+               vipx_info("[%20s] memory is allocated(%#x,%zuKB)",
+                               pmem->name, (int)pmem->dvaddr,
+                               pmem->size / SZ_1K);
 
        vipx_leave();
        return 0;
index cdd15cdc5dab2e1bdddd980c3bec8d2fa4e48bfb..7f6509cc112cd63d27d254abf19bd3b165f49951 100644 (file)
@@ -334,6 +334,7 @@ static int __vipx_queue_bundle_prepare(struct vipx_queue *queue,
                        }
                        break;
                default:
+                       ret = -EINVAL;
                        vipx_err("container memory type is invalid (%u)\n",
                                        con[c_cnt].memory);
                        goto p_err;
@@ -381,6 +382,7 @@ static int __vipx_queue_bundle_unprepare(struct vipx_queue *queue,
                                __vipx_queue_unmap_dmabuf(queue, &buf[b_cnt]);
                        break;
                default:
+                       ret = -EINVAL;
                        vipx_err("container memory type is invalid (%u)\n",
                                        con[c_cnt].memory);
                        goto p_err;
index 16dbe881de28322ac738215f4a169a73769bfa94..6813164b91755c02579f6ba05378331328425743 100644 (file)
@@ -335,6 +335,7 @@ static int __vertex_queue_bundle_prepare(struct vertex_queue *queue,
                        }
                        break;
                default:
+                       ret = -EINVAL;
                        vertex_err("container memory type is invalid (%u)\n",
                                        con[c_cnt].memory);
                        goto p_err;
@@ -382,6 +383,7 @@ static int __vertex_queue_bundle_unprepare(struct vertex_queue *queue,
                                __vertex_queue_unmap_dmabuf(queue, &buf[b_cnt]);
                        break;
                default:
+                       ret = -EINVAL;
                        vertex_err("container memory type is invalid (%u)\n",
                                        con[c_cnt].memory);
                        goto p_err;