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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/