• A
    ovl: fix bogus -Wmaybe-unitialized warning · 0319ef1d
    Arnd Bergmann 提交于
    [ Upstream commit 1dac6f5b0ed2601be21bb4e27a44b0c3e667b7f4 ]
    
    gcc gets a bit confused by the logic in ovl_setup_trap() and
    can't figure out whether the local 'trap' variable in the caller
    was initialized or not:
    
    fs/overlayfs/super.c: In function 'ovl_fill_super':
    fs/overlayfs/super.c:1333:4: error: 'trap' may be used uninitialized in this function [-Werror=maybe-uninitialized]
        iput(trap);
        ^~~~~~~~~~
    fs/overlayfs/super.c:1312:17: note: 'trap' was declared here
    
    Reword slightly to make it easier for the compiler to understand.
    
    Fixes: 146d62e5a586 ("ovl: detect overlapping layers")
    Signed-off-by: NArnd Bergmann <arnd@arndb.de>
    Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
    Signed-off-by: NSasha Levin <sashal@kernel.org>
    0319ef1d
super.c 40.9 KB