lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090604020624.4d39e0a3.akpm@linux-foundation.org>
Date:	Thu, 4 Jun 2009 02:06:24 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Minkyu Kang <mk7.kang@...sung.com>
Cc:	linux-kernel@...r.kernel.org, linux-pm@...ts.linux-foundation.org,
	kyungmin.park@...sung.com, Anton Vorontsov <cbou@...l.ru>
Subject: Re: [PATCH v2] add MAX17040 Fuel Gauge driver

On Thu, 04 Jun 2009 17:55:36 +0900 Minkyu Kang <mk7.kang@...sung.com> wrote:

> +	INIT_DELAYED_WORK_DEFERRABLE(&chip->work, max17040_work);
> +	schedule_delayed_work(&chip->work, MAX17040_DELAY);
> +
> +	bat_ps.properties = max17040_battery_props;
> +	bat_ps.num_properties = ARRAY_SIZE(max17040_battery_props);
> +
> +	ret = power_supply_register(&client->dev, &bat_ps);
> +	if (ret) {
> +		dev_err(&max17040->client->dev,
> +				"failed: power supply register\n");
> +		cancel_delayed_work(&chip->work);
> +		i2c_set_clientdata(client, NULL);
> +		kfree(chip);
> +		max17040 = NULL;
> +		return -1;
> +	}
> +
> +	return 0;
> +}

Wouldn't it be better to start the delayed_work after the
power_supply_register() has succeeded?

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ