Changeset 3483


Ignore:
Timestamp:
2006-03-25T15:31:42+01:00 (12 years ago)
Author:
nbd
Message:

fix gcc4-related bug in switch-robo

Location:
trunk/openwrt/target/linux/package/switch/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/openwrt/target/linux/package/switch/src/switch-core.c

    r3223 r3483  
    6868        write: switch_proc_write 
    6969}; 
    70  
    71 static inline char *strdup(char *str) 
    72 { 
    73         char *new = kmalloc(strlen(str) + 1, GFP_KERNEL); 
    74         strcpy(new, str); 
    75         return new; 
    76 } 
    7770 
    7871static ssize_t switch_proc_read(struct file *file, char *buf, size_t count, loff_t *ppos) 
  • trunk/openwrt/target/linux/package/switch/src/switch-core.h

    r2925 r3483  
    4949extern int switch_print_media(char *buf, int media); 
    5050 
     51static inline char *strdup(char *str) 
     52{ 
     53        char *new = kmalloc(strlen(str) + 1, GFP_KERNEL); 
     54        strcpy(new, str); 
     55        return new; 
     56} 
     57 
     58 
    5159#endif 
  • trunk/openwrt/target/linux/package/switch/src/switch-robo.c

    r3045 r3483  
    5252#define SIOCSETCPHYWR           (SIOCDEVPRIVATE + 10) 
    5353 
     54static char *device; 
    5455static int use_et = 0; 
    5556static int is_5350 = 0; 
     
    426427static int __init robo_init() 
    427428{ 
    428         char *device = "ethX"; 
    429429        int notfound = 1; 
    430430 
     431        device = strdup("ethX"); 
    431432        for (device[3] = '0'; (device[3] <= '3') && notfound; device[3]++) { 
    432433                notfound = robo_probe(device); 
     
    434435        device[3]--; 
    435436         
    436         if (notfound) 
     437        if (notfound) { 
     438                kfree(device); 
    437439                return -ENODEV; 
    438         else { 
     440        } else { 
    439441                switch_config cfg[] = { 
    440442                        {"enable", handle_enable_read, handle_enable_write}, 
     
    466468{ 
    467469        switch_unregister_driver(DRIVER_NAME); 
     470        kfree(device); 
    468471} 
    469472 
Note: See TracChangeset for help on using the changeset viewer.