All of lore.kernel.org
 help / color / mirror / Atom feed
From: jonghwa3.lee@samsung.com
To: Oliver Neukum <oneukum@suse.de>, Jenny TC <jenny.tc@intel.com>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sebastian Reichel <sre@kernel.org>,
	Anton Vorontsov <anton.vorontsov@linaro.org>,
	David Woodhouse <dwmw2@infradead.org>,
	myungjoo.ham@gmail.com,
	Pallala Ramakrishna <ramakrishna.pallala@intel.com>
Subject: Re: [RFC 2/4] power: core: Add generic interface to get battery specification.
Date: Mon, 09 Mar 2015 20:24:30 +0900	[thread overview]
Message-ID: <54FD82EE.7070408@samsung.com> (raw)
In-Reply-To: <1425640566.2197.2.camel@suse.de>

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

  reply	other threads:[~2015-03-09 11:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-06 10:33 [RFC 0/4] Enable power supply charging control Jenny TC
2015-03-06 10:33 ` [RFC 1/4] power_supply: Introduce charging object table Jenny TC
2015-03-06 11:12   ` Oliver Neukum
2015-03-08  1:31     ` Sebastian Reichel
2015-03-08  1:00   ` Sebastian Reichel
2015-03-06 10:33 ` [RFC 2/4] power: core: Add generic interface to get battery specification Jenny TC
2015-03-06 11:16   ` Oliver Neukum
2015-03-09 11:24     ` jonghwa3.lee [this message]
2015-03-06 10:33 ` [RFC 3/4] power_supply: Introduce charger control interface Jenny TC
2015-03-08  1:55   ` Sebastian Reichel
2015-03-09 12:47     ` Tc, Jenny
2015-03-09 14:55       ` Sebastian Reichel
2015-03-06 10:33 ` [RFC 4/4] charger-manager: Enable psy based charge control Jenny TC
2015-03-08  2:14   ` Sebastian Reichel
2015-03-10  5:21     ` Tc, Jenny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54FD82EE.7070408@samsung.com \
    --to=jonghwa3.lee@samsung.com \
    --cc=anton.vorontsov@linaro.org \
    --cc=dwmw2@infradead.org \
    --cc=jenny.tc@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=myungjoo.ham@gmail.com \
    --cc=oneukum@suse.de \
    --cc=ramakrishna.pallala@intel.com \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.