LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: linux-input@atrey.karlin.mff.cuni.cz,
linux-kernel@vger.kernel.org,
Dmitry Baryshkov <dbaryshkov@gmail.com>,
Liam Girdwood <liam.girdwood@wolfsonmicro.com>,
Graeme Gregory <gg@opensource.wolfsonmicro.com>,
Mike Arthur <mike.arthur@wolfsonmicro.com>,
Stanley Cai <stanley.cai@intel.com>,
Rodolfo Giometti <giometti@enneenne.com>,
Russell King <rmk@arm.linux.org.uk>,
Marc Kleine-Budde <mkl@pengutronix.de>,
Ian Molton <spyro@f2s.com>, Vincent Sanders <vince@kyllikki.org>,
Andrew Zabolotny <zap@homelink.ru>
Subject: Re: [PATCH 1/6] Core driver for WM97xx touchscreens
Date: Thu, 7 Feb 2008 17:07:23 -0500 [thread overview]
Message-ID: <20080207170112.ZZRA012@mailhub.coreip.homeip.net> (raw)
In-Reply-To: <1201368516-3513-1-git-send-email-broonie@opensource.wolfsonmicro.com>
Hi Mark,
On Sat, Jan 26, 2008 at 05:28:31PM +0000, Mark Brown wrote:
> +
> + /* register our battery device */
> + wm->battery_dev = platform_device_alloc("wm97xx-battery", 0);
> + if (!wm->battery_dev)
> + goto batt_err;
...
> + batt_err:
> + input_unregister_device(wm->input_dev);
> + kfree(wm);
> + return ret;
> +}
The probe error handling is not quite correct. When we reach the fragment
above ret variable is 0 so if platfrom_device_alloc() fails we will return
0 and the device will be considered bound but in half-dead state. Please
make sure that proper error is returned in all cases. Also please do not
mix out of line and in-line error unwinding (input_free_device() should
be called in the error path and if you are concerned about double-free
after input_unregister_device() just set wm->input_dev to NULL there).
Thanks.
--
Dmitry
next prev parent reply other threads:[~2008-02-07 22:07 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-26 15:18 [UPDATED v4] WM97xx touchscreen drivers Mark Brown
2008-01-26 17:28 ` [PATCH 1/6] Core driver for WM97xx touchscreens Mark Brown
2008-01-26 17:28 ` [PATCH 2/6] Add chip driver for WM9705 touchscreen Mark Brown
2008-01-26 17:28 ` [PATCH 3/6] Add chip driver for WM9712 touchscreen Mark Brown
2008-01-26 17:28 ` [PATCH 4/6] Add chip driver for WM9713 touchscreen Mark Brown
2008-01-26 17:28 ` [PATCH 5/6] Driver for WM97xx touchscreens in streaming mode on Mainstone Mark Brown
2008-01-26 17:28 ` [PATCH 6/6] Build system and MAINTAINERS entry for WM97xx touchscreen drivers Mark Brown
2008-02-07 22:07 ` Dmitry Torokhov [this message]
2008-02-08 11:27 ` [PATCH 1/6] Core driver for WM97xx touchscreens Mark Brown
2008-02-08 11:27 ` [PATCH] " Mark Brown
2008-02-08 11:27 ` [PATCH] Add chip driver for WM9705 touchscreen Mark Brown
2008-02-08 11:27 ` [PATCH] Add chip driver for WM9712 touchscreen Mark Brown
2008-02-08 11:27 ` [PATCH] Add chip driver for WM9713 touchscreen Mark Brown
2008-02-08 11:27 ` [PATCH] Driver for WM97xx touchscreens in streaming mode on Mainstone Mark Brown
2008-02-08 11:27 ` [PATCH] Build system and MAINTAINERS entry for WM97xx touchscreen drivers Mark Brown
2008-01-29 22:03 ` [UPDATED v4] " Dmitry Baryshkov
-- strict thread matches above, loose matches on Subject: below --
2008-04-01 10:28 Mark Brown
2008-04-01 10:36 ` [PATCH 1/6] Core driver for WM97xx touchscreens Mark Brown
2008-03-20 9:39 WM97xx touchscreen drivers Mark Brown
2008-03-20 9:42 ` [PATCH 1/6] Core driver for WM97xx touchscreens Mark Brown
2008-03-04 14:02 WM97xx touchscreen drivers Mark Brown
2008-03-04 14:04 ` [PATCH 1/6] Core driver for WM97xx touchscreens Mark Brown
2008-02-29 16:50 WM97xx touchscreen drivers Mark Brown
2008-02-29 16:52 ` [PATCH 1/6] Core driver for WM97xx touchscreens Mark Brown
[not found] <12040332183316-git-send-email-broonie@opensource.wolfsonmicro.com>
2008-02-26 13:40 ` Mark Brown
2008-02-28 7:09 ` Andrew Morton
2008-02-28 15:30 ` Mark Brown
2008-02-13 14:06 [UPDATED v7] WM97xx touchscreen drivers Mark Brown
2008-02-13 14:13 ` [PATCH 1/6] Core driver for WM97xx touchscreens Mark Brown
2008-02-14 15:10 ` Dmitry
2008-02-14 15:55 ` Mark Brown
2008-02-12 10:17 [UPDATED v6] WM97xx touchscreen drivers Mark Brown
2008-02-12 10:21 ` [PATCH 1/6] Core driver for WM97xx touchscreens Mark Brown
2008-02-12 22:58 ` Dmitry Baryshkov
2008-02-13 11:19 ` Mark Brown
2008-02-13 11:32 ` Dmitry
2008-02-13 4:28 ` Pete MacKay
2008-02-13 10:11 ` Mark Brown
2008-01-21 15:24 [UPDATED v3] WM97xx touchscreen drivers Mark Brown
2008-01-21 15:24 ` [PATCH 1/6] Core driver for WM97xx touchscreens Mark Brown
2008-01-26 9:58 ` Dmitry Baryshkov
2008-01-26 10:18 ` Dmitry Baryshkov
2008-01-26 11:47 ` Mark Brown
2008-01-26 12:05 ` Dmitry
2008-01-10 11:51 Mark Brown
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=20080207170112.ZZRA012@mailhub.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=dbaryshkov@gmail.com \
--cc=gg@opensource.wolfsonmicro.com \
--cc=giometti@enneenne.com \
--cc=liam.girdwood@wolfsonmicro.com \
--cc=linux-input@atrey.karlin.mff.cuni.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.arthur@wolfsonmicro.com \
--cc=mkl@pengutronix.de \
--cc=rmk@arm.linux.org.uk \
--cc=spyro@f2s.com \
--cc=stanley.cai@intel.com \
--cc=vince@kyllikki.org \
--cc=zap@homelink.ru \
--subject='Re: [PATCH 1/6] Core driver for WM97xx touchscreens' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).