gdc: correct max length of config store path [1/1]
authorJian Cao <jian.cao@amlogic.com>
Thu, 20 Jun 2019 13:18:42 +0000 (21:18 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Fri, 21 Jun 2019 08:24:41 +0000 (01:24 -0700)
PD#SWPL-10123

Problem:
max size of config store path is wrong

Solution:
use macro CONFIG_PATH_LENG to set
max length of config store path

Verify:
verified on g12b-w400

Change-Id: I0e2d09515099f77ff95505706a0c3b588135c083
Signed-off-by: Jian Cao <jian.cao@amlogic.com>
drivers/amlogic/media/gdc/app/gdc_module.c

index 211bb83..71ec73e 100644 (file)
@@ -1800,7 +1800,7 @@ static ssize_t config_out_path_show(struct device *dev,
 static ssize_t config_out_path_store(struct device *dev,
                struct device_attribute *attr, const char *buf, size_t len)
 {
-       if (strlen(buf) >= sizeof(config_out_file)) {
+       if (strlen(buf) >= CONFIG_PATH_LENG) {
                pr_info("err: path too long\n");
        } else {
                strncpy(config_out_file, buf, CONFIG_PATH_LENG - 1);