[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241004100842.9052-1-surajsonawane0215@gmail.com>
Date: Fri, 4 Oct 2024 15:38:42 +0530
From: SurajSonawane2415 <surajsonawane0215@...il.com>
To: axboe@...nel.dk
Cc: linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org,
SurajSonawane2415 <surajsonawane0215@...il.com>
Subject: [PATCH] block: Fix uninitialized symbol 'bio' in blk_rq_prep_clone
Fix the uninitialized symbol 'bio' in the function blk_rq_prep_clone
to resolve the following error:
block/blk-mq.c:3199 blk_rq_prep_clone() error: uninitialized symbol 'bio'.
Initialize 'bio' to NULL to prevent undefined behavior from uninitialized
access and safe cleanup in case of failure.
Signed-off-by: SurajSonawane2415 <surajsonawane0215@...il.com>
---
block/blk-mq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 4b2c8e940..b2087bdd9 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -3156,7 +3156,7 @@ int blk_rq_prep_clone(struct request *rq, struct request *rq_src,
int (*bio_ctr)(struct bio *, struct bio *, void *),
void *data)
{
- struct bio *bio, *bio_src;
+ struct bio *bio = NULL, *bio_src;
if (!bs)
bs = &fs_bio_set;
--
2.34.1
Powered by blists - more mailing lists