ALSA: seq: Fix racy cell insertions during snd_seq_pool_done()
[pandora-kernel.git] / drivers / power / test_power.c
index b527c93..c4a0f5a 100644 (file)
@@ -237,6 +237,8 @@ static int map_get_value(struct battery_property_map *map, const char *key,
        buf[MAX_KEYLENGTH-1] = '\0';
 
        cr = strnlen(buf, MAX_KEYLENGTH) - 1;
+       if (cr < 0)
+               return def_val;
        if (buf[cr] == '\n')
                buf[cr] = '\0';