Changeset 5086

Show
Ignore:
Timestamp:
12/27/07 16:35:04 (6 years ago)
Author:
khali
Message:

Don't choke on unrecognized devices (#2087).

Location:
lm-sensors/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r5083 r5086  
    55  Library: Fix fschrc and fschmd support 
    66           Fix sysfs presence detection 
     7           Don't choke on unrecognized devices (#2087) 
    78  Makefile: Revert changeset 4738, fix bug #2187 differently 
    89  Module adm1026: Various cleanups 
  • lm-sensors/trunk/lib/sysfs.c

    r5036 r5086  
    6161        char bus_path[SYSFS_PATH_MAX]; 
    6262        sensors_proc_chips_entry entry; 
     63        int err = -SENSORS_ERR_PARSE; 
    6364 
    6465        /* ignore any device without name attribute */ 
     
    113114                entry.name.addr = (domain << 16) + (bus << 8) + (slot << 3) + fn; 
    114115                entry.name.bus = SENSORS_CHIP_NAME_BUS_PCI; 
    115         } else 
     116        } else { 
     117                /* Ignore unknown devices */ 
     118                err = 0; 
    116119                goto exit_free; 
     120        } 
    117121 
    118122        sensors_add_proc_chips(&entry); 
     
    123127        free(entry.name.prefix); 
    124128        free(entry.name.busname); 
    125         return -SENSORS_ERR_PARSE; 
     129        return err; 
    126130} 
    127131