From: Arnd Bergmann <arnd@arndb.de>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org,
vishnupatekar <vishnupatekar0510@gmail.com>,
maxime.ripard@free-electrons.com, linux-sunxi@googlegroups.com,
devicetree@vger.kernel.org, benh@kernel.crashing.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
ralf@linux-mips.org, robh+dt@kernel.org, msalter@redhat.com,
vishnupatekar <VishnuPatekar0510@gmail.com>,
jdelvare@suse.de
Subject: Re: [PATCH 2/3] drivers:input:ps2 Added sunxi A20 ps2 driver, changed makefile and Kconfig
Date: Fri, 05 Dec 2014 16:50:18 +0100 [thread overview]
Message-ID: <2906898.Fr1ixVkiAI@wuerfel> (raw)
In-Reply-To: <63D786FF-B293-4FC1-AD71-D99515DE8E3D@gmail.com>
On Friday 05 December 2014 07:01:17 Dmitry Torokhov wrote:
>
> On December 5, 2014 2:33:11 AM PST, Arnd Bergmann <arnd@arndb.de> wrote:
> >On Thursday 04 December 2014 04:23:44 vishnupatekar wrote:
> >> +
> >> +struct sunxips2data {
> >> + int irq;
> >> + spinlock_t ps2_lock;
> >> + void __iomem *base_address; /* virt address of control registers*/
> >> + struct serio *serio; /* serio*/
> >> + struct device *dev;
> >> + struct clk *pclk;
> >> +};
> >
> >As this is dynamically allocated, better embed the serio member
> >directly to avoid allocating both separately.
>
> That would be wrong - serio is refcounted and it may outlive instance of sunxips2data you embedded it into.
Ok, I see. I guess in this case the use of devm_kzalloc for serio is a bug,
because that would lead to a double free upon module unload, right?
Arnd
next prev parent reply other threads:[~2014-12-05 15:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-03 22:53 [PATCH 2/3] drivers:input:ps2 Added sunxi A20 ps2 driver, changed makefile and Kconfig vishnupatekar
2014-12-03 23:23 ` Dmitry Torokhov
2014-12-05 10:01 ` Maxime Ripard
2014-12-05 10:33 ` Arnd Bergmann
2014-12-05 15:01 ` Dmitry Torokhov
2014-12-05 15:50 ` Arnd Bergmann [this message]
2014-12-05 15:53 ` Dmitry Torokhov
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=2906898.Fr1ixVkiAI@wuerfel \
--to=arnd@arndb.de \
--cc=benh@kernel.crashing.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=jdelvare@suse.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@googlegroups.com \
--cc=maxime.ripard@free-electrons.com \
--cc=msalter@redhat.com \
--cc=ralf@linux-mips.org \
--cc=robh+dt@kernel.org \
--cc=vishnupatekar0510@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox