lkml.org 
[lkml]   [2022]   [Dec]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] udf: Initialize newblock variable COVERITY: 1530250
From
Date
From 21f30c35ba12c939da0990a8527790408276aaee Mon Sep 17 00:00:00 2001
From: Tanmay Bhushan <007047221b@gmail.com>
Date: Mon, 26 Dec 2022 18:54:13 +0100
Subject: [PATCH] udf: Initialize newblock variable COVERITY: 1530250

When getting newblock the variable returned is not initialized.
Coverity informs this as a high risk impact because variable may
contain an arbitrary value left from earlier computations. Newblock
is initialized to avoid this issue.

Signed-off-by: Tanmay Bhushan <007047221b@gmail.com>
---
fs/udf/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 1d7c2a812fc1..71bc4de38ad2 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -684,7 +684,7 @@ static sector_t inode_getblk(struct inode *inode,
sector_t block,
struct kernel_lb_addr eloc, tmpeloc;
int c = 1;
loff_t lbcount = 0, b_off = 0;
- udf_pblk_t newblocknum, newblock;
+ udf_pblk_t newblocknum, newblock = 0;
sector_t offset = 0;
int8_t etype;
struct udf_inode_info *iinfo = UDF_I(inode);
--
2.34.1

\
 
 \ /
  Last update: 2023-03-26 23:21    [W:0.027 / U:1.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site