On 29/08/2016 13:57, walter harms wrote:
> > > - buf = kmalloc(sizeof(char) * (count + 1), GFP_KERNEL);
> > > + buf = kmalloc_array(count + 1, sizeof(*buf), GFP_KERNEL);
> > > if (!buf)
> > > return -ENOMEM;
> > >
> >
> > Here it's probably best to just remove sizeof(char) complete
Am 29.08.2016 11:47, schrieb Paolo Bonzini:
>
>
> On 25/08/2016 10:22, SF Markus Elfring wrote:
>> --- a/arch/sparc/kernel/led.c
>> +++ b/arch/sparc/kernel/led.c
>> @@ -69,7 +69,7 @@ static ssize_t led_proc_write(struct file *file, const
>> char __user *buffer,
>> if (count > LED_MAX_LENG
>> @@ -69,7 +69,7 @@ static ssize_t led_proc_write(struct file *file, const
>> char __user *buffer,
>> if (count > LED_MAX_LENGTH)
>> count = LED_MAX_LENGTH;
>>
>> -buf = kmalloc(sizeof(char) * (count + 1), GFP_KERNEL);
>> +buf = kmalloc_array(count + 1, sizeof(*buf), G
On 25/08/2016 10:22, SF Markus Elfring wrote:
> --- a/arch/sparc/kernel/led.c
> +++ b/arch/sparc/kernel/led.c
> @@ -69,7 +69,7 @@ static ssize_t led_proc_write(struct file *file, const char
> __user *buffer,
> if (count > LED_MAX_LENGTH)
> count = LED_MAX_LENGTH;
>
> -
From: Markus Elfring
Date: Thu, 25 Aug 2016 09:52:44 +0200
* Multiplications for the size determination of memory allocations
indicated that array data structures should be processed.
Thus reuse the corresponding function "kmalloc_array".
This issue was detected by using the Coccinelle sof
5 matches
Mail list logo