mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
iio: potentiometer: ds1803: Remove VLA usage
In preparation to enabling -Wvla, remove VLA usage and replace it with fixed a fixed length array and therefore, prevent potential stack overflow attacks. Fixed as a part of the discussion to remove all VLAs from the kernel: https://lkml.org/lkml/2018/3/7/621 Cc: [email protected] Signed-off-by: Himanshu Jha <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
This commit is contained in:
parent
2ab5b72453
commit
a937729c93
1 changed files with 1 additions and 1 deletions
|
|
@ -64,7 +64,7 @@ static int ds1803_read_raw(struct iio_dev *indio_dev,
|
|||
struct ds1803_data *data = iio_priv(indio_dev);
|
||||
int pot = chan->channel;
|
||||
int ret;
|
||||
u8 result[indio_dev->num_channels];
|
||||
u8 result[ARRAY_SIZE(ds1803_channels)];
|
||||
|
||||
switch (mask) {
|
||||
case IIO_CHAN_INFO_RAW:
|
||||
|
|
|
|||
Loading…
Reference in a new issue