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>
This commit is contained in:
Brian Norris 2014-07-21 19:06:39 -07:00
parent 0c2b4e2144
commit f7f0d358f5
1 changed files with 1 additions and 1 deletions

View File

@ -1058,7 +1058,7 @@ static int sm_write(struct mtd_blktrans_dev *dev,
{
struct sm_ftl *ftl = dev->priv;
struct ftl_zone *zone;
int error, zone_num, block, boffset;
int error = 0, zone_num, block, boffset;
BUG_ON(ftl->readonly);
sm_break_offset(ftl, sec_no << 9, &zone_num, &block, &boffset);