lkml.org 
[lkml]   [2020]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] mm: initialize return of vm_insert_pages
From
Date

On 7/3/20 7:54 AM, Matthew Wilcox wrote:
> On Fri, Jul 03, 2020 at 07:52:02AM -0700, trix@redhat.com wrote:
>> From: Tom Rix <trix@redhat.com>
>>
>> clang static analysis reports a garbage return
>>
>> In file included from mm/memory.c:84:
>> mm/memory.c:1612:2: warning: Undefined or garbage value returned to caller [core.uninitialized.UndefReturn]
>> return err;
>> ^~~~~~~~~~
>>
>> The setting of err depends on a loop executing.
>> So initialize err.
> I'd argue that returning zero is wrong. If someone's asked to insert
> zero pages, that's a nonsense thing to do so it should return -EINVAL..
>
good point, i'll respin.


\
 
 \ /
  Last update: 2020-07-03 17:46    [W:0.060 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site