Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Wsometimes-uninitialized in drivers/mtd/ubi/wl.c #383

Closed
nickdesaulniers opened this issue Feb 26, 2019 · 4 comments
Closed

-Wsometimes-uninitialized in drivers/mtd/ubi/wl.c #383

nickdesaulniers opened this issue Feb 26, 2019 · 4 comments
Assignees
Labels
-Wsometimes-uninitialized [ARCH] arm32 This bug impacts ARCH=arm [BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle

Comments

@nickdesaulniers
Copy link
Member

reported in #381

drivers/mtd/ubi/wl.c:1514:6: error: variable 'err' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
@nickdesaulniers nickdesaulniers added good first issue Good for newcomers [BUG] linux A bug that should be fixed in the mainline kernel. low priority This bug is not critical and not a priority [ARCH] arm32 This bug impacts ARCH=arm -Wsometimes-uninitialized labels Feb 26, 2019
@nickdesaulniers
Copy link
Member Author

err should be initialized to 0. Otherwise if (err == UBI_IO_BITFLIPS || force) { is potentially a comparison against uninitialized stack memory (UB).

@nickdesaulniers
Copy link
Member Author

ubi_bitflip_check is only in linux-next.

@nickdesaulniers nickdesaulniers added [BUG] linux-next This is an issue only seen in linux-next and removed [BUG] linux A bug that should be fixed in the mainline kernel. labels Feb 26, 2019
@nathanchance nathanchance self-assigned this Feb 28, 2019
@nathanchance
Copy link
Member

Dan Carpenter sent a fix for this independently: https://lore.kernel.org/linux-mtd/20190228053551.GB3253@kadam/

I'll track this one.

@nathanchance nathanchance added [PATCH] Submitted A patch has been submitted for review and removed good first issue Good for newcomers low priority This bug is not critical and not a priority labels Feb 28, 2019
@nathanchance
Copy link
Member

This is fixed in next-20190306: https://git.kernel.org/next/linux-next/c/5578e48e5c0bf4684e68ae08caa2293bfb3f5307

@nathanchance nathanchance added [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle and removed [PATCH] Submitted A patch has been submitted for review labels Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Wsometimes-uninitialized [ARCH] arm32 This bug impacts ARCH=arm [BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle
Projects
None yet
Development

No branches or pull requests

2 participants