From: Adrian Bunk Date: Thu, 19 Oct 2006 13:20:04 +0000 (+0200) Subject: [GFS2] fs/gfs2/dir.c:gfs2_dir_write_data(): don't use an uninitialized variable X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=348acd48f050f5ba7fa917b1421ae34443be97dd;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [GFS2] fs/gfs2/dir.c:gfs2_dir_write_data(): don't use an uninitialized variable In the "if (extlen)" case, "new" might be used uninitialized. Looking at the code, it should be initialized to 0. Spotted by the Coverity checker. Signed-off-by: Adrian Bunk Signed-off-by: Steven Whitehouse --- diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index ce52bd954df6..ead7df066853 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c @@ -184,7 +184,7 @@ static int gfs2_dir_write_data(struct gfs2_inode *ip, const char *buf, while (copied < size) { unsigned int amount; struct buffer_head *bh; - int new; + int new = 0; amount = size - copied; if (amount > sdp->sd_sb.sb_bsize - o)