Changeset 35622


Ignore:
Timestamp:
2013-02-16T16:19:24+01:00 (5 years ago)
Author:
hauke
Message:

brcm47xx: handle return values of cfe_env_get() correctly.

This closes #12746.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/brcm47xx/patches-3.6/820-wgt634u-nvram-fix.patch

    r35322 r35622  
    281281        off = FLASH_MIN; 
    282282        while (off <= lim) { 
    283 @@ -181,6 +203,12 @@ int bcm47xx_nvram_getenv(char *name, cha 
     283@@ -181,6 +203,13 @@ int bcm47xx_nvram_getenv(char *name, cha 
    284284                        return err; 
    285285        } 
     
    287287+       if (cfe_env) { 
    288288+               value = cfe_env_get(nvram_buf, name); 
    289 +               snprintf(val, val_len, "%s", value); 
    290 +               return 0; 
     289+               if (!value) 
     290+                       return -ENOENT; 
     291+               return snprintf(val, val_len, "%s", value); 
    291292+       } 
    292293+ 
     
    294295        var = &nvram_buf[sizeof(struct nvram_header)]; 
    295296        end = nvram_buf + sizeof(nvram_buf) - 2; 
    296 @@ -209,6 +237,9 @@ char *nvram_get(const char *name) 
     297@@ -209,6 +238,9 @@ char *nvram_get(const char *name) 
    297298        if (!nvram_buf[0]) 
    298299                nvram_init(); 
Note: See TracChangeset for help on using the changeset viewer.