[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vfb7Evhf6yMNd4nzcL9TM5Svu6Z1_MPPAWkmBjhgeDJ8A@mail.gmail.com>
Date: Mon, 10 Jun 2013 09:41:52 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Wolfram Sang <wsa@...-dreams.de>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Thierry Reding <thierry.reding@...onic-design.de>
Subject: Re: [PATCH] pwm: devm: alloc correct pointer size
On Mon, Jun 10, 2013 at 3:04 AM, Wolfram Sang <wsa@...-dreams.de> wrote:
> On Thu, Jun 06, 2013 at 10:43:41PM +0300, Andy Shevchenko wrote:
>> On Mon, Jun 3, 2013 at 11:27 PM, Wolfram Sang <wsa@...-dreams.de> wrote:
>> > The allocated object should be the size of what the pointer is pointing
>> > to and not the size of the pointer itself.
>>
>> All devm_* functions in this module use **ptr as a parameter (except
>> allocation).
>> May be we first should understand why it so?
>
> Huh? **ptr is already created on the stack, but assigned the alloced
> memory. Later, the mem it points to is set to 'pwm' which is then added
> to devres. So, the alloced memory must be able to contain '*ptr' (or
> *pwm which would be more readable IMO, but other subsystems also stick
> to *ptr), no?
Yes, you right.
Take my Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>
--
With Best Regards,
Andy Shevchenko
--
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