[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5018FFE4.4010508@pengutronix.de>
Date: Wed, 01 Aug 2012 12:07:32 +0200
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Fabio Baltieri <fabio.baltieri@...il.com>
CC: linux-can@...r.kernel.org, linux-kernel@...r.kernel.org,
Oliver Hartkopp <socketcan@...tkopp.net>,
Wolfgang Grandegger <wg@...ndegger.com>
Subject: Re: [PATCH can-next v4] can: add tx/rx LED trigger support
On 08/01/2012 11:36 AM, Marc Kleine-Budde wrote:
[...]
>> +/*
>> + * Register CAN LED triggers for a CAN device
>> + *
>> + * This is normally called from a driver's probe function
>> + */
>> +void can_led_init(struct net_device *netdev)
>> +{
>> + struct can_priv *priv = netdev_priv(netdev);
>> + void *res;
>> +
>> + res = devres_alloc(can_led_release, 0, GFP_KERNEL);
> ^
> I'm not really sure if this is working. For example, pinctrl [1]
> allocates a double pointer here. The res pointer here and in
> can_led_release simply points to invalid memory. But as long as you
> don't dereference it, it should work.
>
> [1] http://lxr.free-electrons.com/source/drivers/pinctrl/core.c#L862
The pinctrl usecase if different, pinctrl needs that extra memory
because they cannot get a reference to their pinctrl they have to put.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
Download attachment "signature.asc" of type "application/pgp-signature" (263 bytes)
Powered by blists - more mailing lists