Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: sm_ftl: initialize error code

There is one theoretical case that could fall through to using an
uninitialized value as the return code. Let's give it a value of 0.

Untested.

Caught by Coverity.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>

+1 -1
+1 -1
drivers/mtd/sm_ftl.c
··· 1058 1058 { 1059 1059 struct sm_ftl *ftl = dev->priv; 1060 1060 struct ftl_zone *zone; 1061 - int error, zone_num, block, boffset; 1061 + int error = 0, zone_num, block, boffset; 1062 1062 1063 1063 BUG_ON(ftl->readonly); 1064 1064 sm_break_offset(ftl, sec_no << 9, &zone_num, &block, &boffset);