[COMMON] thermal: isp_cooling: Fix SVACE(WGID:82271) bug
authorSoomin Kim <sm8326.kim@samsung.com>
Mon, 2 Jan 2017 04:59:47 +0000 (13:59 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:18:09 +0000 (17:18 +0900)
Since thermal_block and function are already checked above,
these can't be NULL. So, remove unnecessary code.

Change-Id: I88f589684de306c8930253cd8195b5ac6cd52a5e
Signed-off-by: Soomin Kim <sm8326.kim@samsung.com>
drivers/thermal/isp_cooling.c

index 8e35ea32583533ba35e28b1157fb013201b60ab1..4330e30a1ff5f919854f9e2e62b5e6926150c837 100644 (file)
@@ -521,26 +521,22 @@ int isp_cooling_table_init(struct platform_device *pdev)
        /* Table size can be num_of_range + 1 since last row has the value of TABLE_END */
        isp_fps_table = kzalloc(sizeof(struct isp_fps_table) * (function->num_of_range + 1), GFP_KERNEL);
 
-       if (thermal_block != NULL && function != NULL) {
-               for (i = 0; i < function->num_of_range; i++) {
-                       if (last_fps == function->range_list[i].max_frequency)
-                               continue;
-
-                       isp_fps_table[count].flags = 0;
-                       isp_fps_table[count].driver_data = count;
-                       isp_fps_table[count].fps = function->range_list[i].max_frequency;
-                       last_fps = isp_fps_table[count].fps;
+       for (i = 0; i < function->num_of_range; i++) {
+               if (last_fps == function->range_list[i].max_frequency)
+                       continue;
 
-                       dev_info(&pdev->dev, "[ISP TMU] index : %d, fps : %d \n",
-                               isp_fps_table[count].driver_data, isp_fps_table[count].fps);
-                       count++;
-               }
+               isp_fps_table[count].flags = 0;
+               isp_fps_table[count].driver_data = count;
+               isp_fps_table[count].fps = function->range_list[i].max_frequency;
+               last_fps = isp_fps_table[count].fps;
 
-               if (i == function->num_of_range)
-                       isp_fps_table[count].fps = ISP_FPS_TABLE_END;
+               dev_info(&pdev->dev, "[ISP TMU] index : %d, fps : %d \n",
+                       isp_fps_table[count].driver_data, isp_fps_table[count].fps);
+               count++;
+       }
 
-       } else
-               return -EINVAL;
+       if (i == function->num_of_range)
+               isp_fps_table[count].fps = ISP_FPS_TABLE_END;
 #else
        /* isp cooling frequency table parse */
        ret = of_property_read_u32(pdev->dev.of_node, "isp_idx_num", &isp_idx_num);