mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tanmay Bhushan <007047221b@gmail.com>
To: Jan Kara <jack@suse.com>, linux-kernel@vger.kernel.org
Subject: [PATCH] udf: Initialize newblock variable COVERITY: 1530250
Date: Mon, 26 Dec 2022 19:57:00 +0100	[thread overview]
Message-ID: <bf7ba34700b1e96a27a031316e811be4d2accfbd.camel@gmail.com> (raw)

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



             reply	other threads:[~2022-12-26 18:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-26 18:57 Tanmay Bhushan [this message]
2023-01-02 12:53 ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf7ba34700b1e96a27a031316e811be4d2accfbd.camel@gmail.com \
    --to=007047221b@gmail.com \
    --cc=jack@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®