Skip to content
Permalink
Browse files
fs/btrfs: Fix uninitialized variable
As reported by the Coverity static analysis.
The variable zone is not initialized which
may causes a failed assertion.

Addresses-Coverity: ("Uninitialized variables")
Signed-off-by: Khaled ROMDHANI <khaledromdhani216@gmail.com>
  • Loading branch information
khaled-R216 authored and intel-lab-lkp committed Apr 20, 2021
1 parent 9749b57 commit c05b2a58c9ed11bd753f1e64695bd89da715fbaa
Showing 1 changed file with 3 additions and 0 deletions.
@@ -143,6 +143,9 @@ static inline u32 sb_zone_number(int shift, int mirror)
case 0: zone = 0; break;
case 1: zone = 1ULL << (BTRFS_SB_LOG_FIRST_SHIFT - shift); break;
case 2: zone = 1ULL << (BTRFS_SB_LOG_SECOND_SHIFT - shift); break;
default:
ASSERT(zone);
break;
}

ASSERT(zone <= U32_MAX);

0 comments on commit c05b2a5

Please sign in to comment.