summaryrefslogtreecommitdiffstats
path: root/target/linux/brcm47xx
diff options
context:
space:
mode:
authorhauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-02-16 15:19:24 +0000
committerhauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-02-16 15:19:24 +0000
commit314d078dd56380cd6e658d774aa705ff597994cb (patch)
tree4a5fc8a5752160a6b01660729aa667a06090a862 /target/linux/brcm47xx
parenta6416d65a2343b65811e0dbaa937b1f5bdb26c6f (diff)
brcm47xx: handle return values of cfe_env_get() correctly.
This closes #12746. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35622 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm47xx')
-rw-r--r--target/linux/brcm47xx/patches-3.6/820-wgt634u-nvram-fix.patch9
1 files changed, 5 insertions, 4 deletions
diff --git a/target/linux/brcm47xx/patches-3.6/820-wgt634u-nvram-fix.patch b/target/linux/brcm47xx/patches-3.6/820-wgt634u-nvram-fix.patch
index ef527c701..2c135a111 100644
--- a/target/linux/brcm47xx/patches-3.6/820-wgt634u-nvram-fix.patch
+++ b/target/linux/brcm47xx/patches-3.6/820-wgt634u-nvram-fix.patch
@@ -280,20 +280,21 @@ 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) {
-@@ -181,6 +203,12 @@ int bcm47xx_nvram_getenv(char *name, cha
+@@ -181,6 +203,13 @@ int bcm47xx_nvram_getenv(char *name, cha
return err;
}
+ if (cfe_env) {
+ value = cfe_env_get(nvram_buf, name);
-+ snprintf(val, val_len, "%s", value);
-+ return 0;
++ if (!value)
++ return -ENOENT;
++ 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) - 2;
-@@ -209,6 +237,9 @@ char *nvram_get(const char *name)
+@@ -209,6 +238,9 @@ char *nvram_get(const char *name)
if (!nvram_buf[0])
nvram_init();