Skip to content

Commit

Permalink
UBI: Silence an unintialized variable warning
Browse files Browse the repository at this point in the history
My static checker complains that "val" is uninitialized when kstrtoint()
fails.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Dan Carpenter authored and Richard Weinberger committed May 24, 2016
1 parent fadb366 commit 24663e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mtd/ubi/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ static ssize_t dfs_file_write(struct file *file, const char __user *user_buf,
} else if (dent == d->dfs_emulate_power_cut) {
if (kstrtoint(buf, 0, &val) != 0)
count = -EINVAL;
d->emulate_power_cut = val;
else
d->emulate_power_cut = val;
goto out;
}

Expand Down

0 comments on commit 24663e7

Please sign in to comment.