osd: fix osd coverity error [1/1]

PD#SWPL-2798

Problem:
fix osd coverity error

Solution:
solve osd coverity issues

Verify:
verified on P212

Change-Id: I9714e3b229786d39ffa5a150633d59082bdf3549
Signed-off-by: Jian Cao <jian.cao@amlogic.com>
This commit is contained in:
Jian Cao
2018-12-06 16:07:41 +08:00
committed by Jianxin Pan
parent f938eedd95
commit 124a3c9fcd
2 changed files with 7 additions and 9 deletions

View File

@@ -570,7 +570,7 @@ static void osd_test_rect(void)
color = 0x0;
osd_log_info("- BLACK -");
osd_log_info("- (%d, %d)-(%d, %d) -\n", x, y, w, h);
fillrect(context, x, y, h, w, color);
fillrect(context, x, y, w, h, color);
msleep(OSD_TEST_DURATION);
x = 100;
@@ -580,21 +580,21 @@ static void osd_test_rect(void)
color = 0xFF0000FF;
osd_log_info("- RED -\n");
osd_log_info("- (%d, %d)-(%d, %d) -\n", x, y, w, h);
fillrect(context, x, y, h, w, color);
fillrect(context, x, y, w, h, color);
msleep(OSD_TEST_DURATION);
x += 100;
color = 0x00FF00FF;
osd_log_info("- GREEN -\n");
osd_log_info("- (%d, %d)-(%d, %d) -\n", x, y, w, h);
fillrect(context, x, y, h, w, color);
fillrect(context, x, y, w, h, color);
msleep(OSD_TEST_DURATION);
x += 100;
color = 0x0000FFFF;
osd_log_info("- BlUE -\n");
osd_log_info("- (%d, %d)-(%d, %d) -\n", x, y, w, h);
fillrect(context, x, y, h, w, color);
fillrect(context, x, y, w, h, color);
msleep(OSD_TEST_DURATION);
memset(cfg_ex, 0, sizeof(struct config_para_ex_s));

View File

@@ -1492,7 +1492,7 @@ static int osd_open(struct fb_info *info, int arg)
fb_ion_client = meson_ion_client_create(-1, "meson-fb");
}
if (get_logo_loaded()) {
u32 logo_index;
s32 logo_index;
logo_index = osd_get_logo_index();
if (logo_index < 0) {
@@ -2147,13 +2147,11 @@ static int parse_para(const char *para, int para_num, int *result)
token++;
len--;
}
if (len == 0)
if ((len == 0) || (!token))
break;
ret = kstrtoint(token, 0, &res);
if (ret < 0)
break;
if (!token)
return 0;
len = strlen(token);
*out++ = res;
count++;
@@ -3795,8 +3793,8 @@ static int osd_probe(struct platform_device *pdev)
b_reserved_mem = true;
#ifdef CONFIG_CMA
cma = dev_get_cma_area(&pdev->dev);
base_addr = cma_get_base(cma);
if (cma) {
base_addr = cma_get_base(cma);
pr_info("reserved memory base:%pa, size:%lx\n",
&base_addr, cma_get_size(cma));
if (fb_memsize[0] > 0) {