display-sys: function mode_string check input parameter.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
This commit is contained in:
Zheng Yang
2015-05-26 14:57:22 +08:00
parent 3f5c5381d9
commit 899286fb6a

View File

@@ -77,6 +77,10 @@ static int mode_string(char *buf, unsigned int offset,
{
char v = 'p';
if (!buf || !mode) {
pr_err("%s parameter error %x %x\n", __func__, buf, mode);
return 0;
}
if (mode->xres == 0 && mode->yres == 0)
return snprintf(&buf[offset], PAGE_SIZE - offset, "auto\n");
/*