lkml.org 
[lkml]   [2013]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] pwm: devm: alloc correct pointer size
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@the-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?

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2013-06-10 02:21    [W:0.061 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site