Re: [PATCH] regulator: vctrl: Fix out of bounds array access for vctrl->vtable

2017-04-14 Thread Matthias Kaehlcke
El Fri, Apr 14, 2017 at 10:11:37AM -0700 Matthias Kaehlcke ha dit: > Hi Axel, > > El Fri, Apr 14, 2017 at 10:50:43AM +0800 Axel Lin ha dit: > > > Current code only allocates rdesc->n_voltages entries for vctrl->vtable. > > Thus use rdesc->n_voltages instead of n_voltages in the for loop. > > Th

Re: [PATCH] regulator: vctrl: Fix out of bounds array access for vctrl->vtable

2017-04-14 Thread Matthias Kaehlcke
Hi Axel, El Fri, Apr 14, 2017 at 10:50:43AM +0800 Axel Lin ha dit: > Current code only allocates rdesc->n_voltages entries for vctrl->vtable. > Thus use rdesc->n_voltages instead of n_voltages in the for loop. This is intended. n_voltages is the number of voltages of the control regulator. In th

[PATCH] regulator: vctrl: Fix out of bounds array access for vctrl->vtable

2017-04-13 Thread Axel Lin
Current code only allocates rdesc->n_voltages entries for vctrl->vtable. Thus use rdesc->n_voltages instead of n_voltages in the for loop. While at it, also switch to use devm_kcalloc instead of devm_kmalloc_array + __GFP_ZERO flag and fix the argument order. Signed-off-by: Axel Lin --- drivers