Skip to content
  • Stefan Weil's avatar
    vdi: Fix warning from clang · 514f21a5
    Stefan Weil authored
    
    
    ccc-analyzer reports these warnings:
    
    block/vdi.c:704:13: warning: Dereference of null pointer
                bmap[i] = VDI_UNALLOCATED;
                ^
    block/vdi.c:702:13: warning: Dereference of null pointer
                bmap[i] = i;
                ^
    
    Moving some code into the if block fixes this.
    It also avoids calling function write with 0 bytes of data.
    
    Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    514f21a5