Re: [RFC 2/4] power: core: Add generic interface to get battery specification.

From: jonghwa3 . lee
Date: Mon Mar 09 2015 - 07:25:03 EST


Hi,
2015ë 03ì 06ì 20:16ì Oliver Neukum ì(ê) ì ê:
>> +
>> + /* Check if same data is existed */
>> + list_for_each_entry(battery, &psy_battery_info_list, entry)
>> + if (!strcmp(battery->info->name, info->name))
>> + return -EEXIST;
>> +
>> + battery = kzalloc(sizeof(*battery), GFP_KERNEL);
>
> That is a race condition. If you check for duplication, you'll
> need a lock.
>

Yes, you`re right. I`ll apply it.

Thanks,
Jonghwa

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/