From 8262cd6372c71d7c4d8d52ce96935d1aec15d83b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 12 Aug 2015 13:30:34 +0000 Subject: brcm47xx: fix reading WGT634U CFE variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We got check for nvram_len placed too early and the code never tried reading CFE variables used on WGT634U. This is a regression introduced in r45942 and reported in #20291. Signed-off-by: Rafał Miłecki Backport of r46584 git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@46585 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../linux/brcm47xx/patches-3.18/820-wgt634u-nvram-fix.patch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'target/linux/brcm47xx') diff --git a/target/linux/brcm47xx/patches-3.18/820-wgt634u-nvram-fix.patch b/target/linux/brcm47xx/patches-3.18/820-wgt634u-nvram-fix.patch index 644abde604..4738c223c4 100644 --- a/target/linux/brcm47xx/patches-3.18/820-wgt634u-nvram-fix.patch +++ b/target/linux/brcm47xx/patches-3.18/820-wgt634u-nvram-fix.patch @@ -279,9 +279,9 @@ out the configuration than the in kernel cfe config reader. /* TODO: when nvram is on nand flash check for bad blocks first. */ off = FLASH_MIN; while (off <= lim) { -@@ -186,6 +208,13 @@ int bcm47xx_nvram_getenv(const char *nam - return err; - } +@@ -180,6 +202,13 @@ int bcm47xx_nvram_getenv(const char *nam + if (!name) + return -EINVAL; + if (cfe_env) { + value = cfe_env_get(nvram_buf, name); @@ -290,6 +290,6 @@ out the configuration than the in kernel cfe config reader. + return snprintf(val, val_len, "%s", value); + } + - /* Look for name=value and return value */ - var = &nvram_buf[sizeof(struct nvram_header)]; - end = nvram_buf + sizeof(nvram_buf); + if (!nvram_len) { + err = nvram_init(); + if (err) -- cgit v1.2.3