From e1461b601d37cde9fa6125022f297964a42acbec Mon Sep 17 00:00:00 2001 From: Jian Cao Date: Thu, 20 Jun 2019 21:18:42 +0800 Subject: [PATCH] gdc: correct max length of config store path [1/1] 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 --- drivers/amlogic/media/gdc/app/gdc_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/amlogic/media/gdc/app/gdc_module.c b/drivers/amlogic/media/gdc/app/gdc_module.c index 211bb835b3b2..71ec73e627c6 100644 --- a/drivers/amlogic/media/gdc/app/gdc_module.c +++ b/drivers/amlogic/media/gdc/app/gdc_module.c @@ -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);