[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <54FD82EE.7070408@samsung.com>
Date: Mon, 09 Mar 2015 20:24:30 +0900
From: jonghwa3.lee@...sung.com
To: Oliver Neukum <oneukum@...e.de>, Jenny TC <jenny.tc@...el.com>
Cc: linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
Sebastian Reichel <sre@...nel.org>,
Anton Vorontsov <anton.vorontsov@...aro.org>,
David Woodhouse <dwmw2@...radead.org>, myungjoo.ham@...il.com,
Pallala Ramakrishna <ramakrishna.pallala@...el.com>
Subject: Re: [RFC 2/4] power: core: Add generic interface to get battery
specification.
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists