Re: memory leak and other oddness in pinctrl-mvebu.c

2013-03-13 Thread Linus Walleij
On Sun, Mar 10, 2013 at 1:06 AM, Jason Cooper wrote: > Added LinusW, Gregory and Ezequiel to the email. Guys, can you give > this a Tested-by before I apply (or Ack for LinusW)? If the Marvell people are happy I'm happy. But I would like to have some Tested-by from Sebastian or so? Also I

Re: memory leak and other oddness in pinctrl-mvebu.c

2013-03-13 Thread Linus Walleij
On Sun, Mar 10, 2013 at 1:06 AM, Jason Cooper ja...@lakedaemon.net wrote: Added LinusW, Gregory and Ezequiel to the email. Guys, can you give this a Tested-by before I apply (or Ack for LinusW)? If the Marvell people are happy I'm happy. But I would like to have some Tested-by from Sebastian

Re: memory leak and other oddness in pinctrl-mvebu.c

2013-03-09 Thread Jason Cooper
Added LinusW, Gregory and Ezequiel to the email. Guys, can you give this a Tested-by before I apply (or Ack for LinusW)? thx, Jason. On Sat, Mar 09, 2013 at 11:39:31PM +, David Woodhouse wrote: > On Sat, 2013-03-09 at 17:53 -0500, Jason Cooper wrote: > > > + if (!nr_funcs) > > > >

Re: memory leak and other oddness in pinctrl-mvebu.c

2013-03-09 Thread David Woodhouse
On Sat, 2013-03-09 at 17:53 -0500, Jason Cooper wrote: > > + if (!nr_funcs) > > shouldn't this be: > > if (nr_funcs <= 0) Hm, no. But the loop should terminate if nr_funcs ever reaches zero, otherwise funcs->num_groups will be off the end of the original array: diff --git

Re: memory leak and other oddness in pinctrl-mvebu.c

2013-03-09 Thread Jason Cooper
On Sat, Mar 09, 2013 at 07:02:05PM +, David Woodhouse wrote: > On Sat, 2013-03-09 at 09:49 +0100, Sebastian Hesselbarth wrote: > > I don't have a strong opinion on that, but I prefer not to have the list > > statically in the SoC specific drivers. I think counting the number of > > unique

Re: memory leak and other oddness in pinctrl-mvebu.c

2013-03-09 Thread Sebastian Hesselbarth
David, I will not be able to test before mid-week ealiest. I added Andrew Lunn to the list. He and Thomas can test your patch for Kirkwood and Armada XP/370 respectively. I will test on Dove asap. Sebastian On Sat, Mar 9, 2013 at 8:02 PM, David Woodhouse wrote: > On Sat, 2013-03-09 at 09:49

Re: memory leak and other oddness in pinctrl-mvebu.c

2013-03-09 Thread David Woodhouse
On Sat, 2013-03-09 at 09:49 +0100, Sebastian Hesselbarth wrote: > I don't have a strong opinion on that, but I prefer not to have the list > statically in the SoC specific drivers. I think counting the number of > unique functions for each SoC specific driver once and verify the above > heuristic

Re: memory leak and other oddness in pinctrl-mvebu.c

2013-03-09 Thread Sebastian Hesselbarth
On 03/08/2013 04:58 PM, David Woodhouse wrote: I'm just looking through the kernel for krealloc() abuse, and the 'interesting' code in mvebu_pinctrl_build_functions() came to my attention. First it allocates an array 'funcs' as follows: /* we allocate functions for number of pins and

Re: memory leak and other oddness in pinctrl-mvebu.c

2013-03-09 Thread Sebastian Hesselbarth
On 03/08/2013 04:58 PM, David Woodhouse wrote: I'm just looking through the kernel for krealloc() abuse, and the 'interesting' code in mvebu_pinctrl_build_functions() came to my attention. First it allocates an array 'funcs' as follows: /* we allocate functions for number of pins and

Re: memory leak and other oddness in pinctrl-mvebu.c

2013-03-09 Thread David Woodhouse
On Sat, 2013-03-09 at 09:49 +0100, Sebastian Hesselbarth wrote: I don't have a strong opinion on that, but I prefer not to have the list statically in the SoC specific drivers. I think counting the number of unique functions for each SoC specific driver once and verify the above heuristic

Re: memory leak and other oddness in pinctrl-mvebu.c

2013-03-09 Thread Sebastian Hesselbarth
David, I will not be able to test before mid-week ealiest. I added Andrew Lunn to the list. He and Thomas can test your patch for Kirkwood and Armada XP/370 respectively. I will test on Dove asap. Sebastian On Sat, Mar 9, 2013 at 8:02 PM, David Woodhouse dw...@infradead.org wrote: On Sat,

Re: memory leak and other oddness in pinctrl-mvebu.c

2013-03-09 Thread Jason Cooper
On Sat, Mar 09, 2013 at 07:02:05PM +, David Woodhouse wrote: On Sat, 2013-03-09 at 09:49 +0100, Sebastian Hesselbarth wrote: I don't have a strong opinion on that, but I prefer not to have the list statically in the SoC specific drivers. I think counting the number of unique functions

Re: memory leak and other oddness in pinctrl-mvebu.c

2013-03-09 Thread David Woodhouse
On Sat, 2013-03-09 at 17:53 -0500, Jason Cooper wrote: + if (!nr_funcs) shouldn't this be: if (nr_funcs = 0) Hm, no. But the loop should terminate if nr_funcs ever reaches zero, otherwise funcs-num_groups will be off the end of the original array: diff --git

Re: memory leak and other oddness in pinctrl-mvebu.c

2013-03-09 Thread Jason Cooper
Added LinusW, Gregory and Ezequiel to the email. Guys, can you give this a Tested-by before I apply (or Ack for LinusW)? thx, Jason. On Sat, Mar 09, 2013 at 11:39:31PM +, David Woodhouse wrote: On Sat, 2013-03-09 at 17:53 -0500, Jason Cooper wrote: + if (!nr_funcs) shouldn't

memory leak and other oddness in pinctrl-mvebu.c

2013-03-08 Thread David Woodhouse
I'm just looking through the kernel for krealloc() abuse, and the 'interesting' code in mvebu_pinctrl_build_functions() came to my attention. First it allocates an array 'funcs' as follows: /* we allocate functions for number of pins and hope * there are less unique functions

memory leak and other oddness in pinctrl-mvebu.c

2013-03-08 Thread David Woodhouse
I'm just looking through the kernel for krealloc() abuse, and the 'interesting' code in mvebu_pinctrl_build_functions() came to my attention. First it allocates an array 'funcs' as follows: /* we allocate functions for number of pins and hope * there are less unique functions