linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: Fix uninitialized symbol 'bio' in blk_rq_prep_clone
@ 2024-10-04 10:08 SurajSonawane2415
  2024-10-04 12:22 ` Christoph Hellwig
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: SurajSonawane2415 @ 2024-10-04 10:08 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel, SurajSonawane2415

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@gmail.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

^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2024-11-19 16:53 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-04 10:08 [PATCH] block: Fix uninitialized symbol 'bio' in blk_rq_prep_clone SurajSonawane2415
2024-10-04 12:22 ` Christoph Hellwig
2024-10-04 14:10   ` Explanation on Uninitialized Variable bio " SurajSonawane2415
2024-10-04 14:15     ` Hannes Reinecke
2024-10-04 14:33     ` John Garry
2024-10-04 14:40       ` Keith Busch
2024-10-06  6:58       ` Suraj Sonawane
2024-10-06  7:11         ` Suraj Sonawane
2024-10-04 14:39     ` Keith Busch
2024-10-06  7:03       ` Suraj Sonawane
2024-10-07  5:50         ` Christoph Hellwig
2024-10-07 19:58 ` [PATCH v2] block: Fix uninitialized symbol 'bio' " SurajSonawane2415
2024-10-08  4:23   ` Christoph Hellwig
2024-10-08 12:04 ` [PATCH v3] " SurajSonawane2415
2024-10-08 12:06   ` Christoph Hellwig
2024-10-08 14:52   ` Keith Busch
2024-10-08 15:35     ` Keith Busch
2024-10-08 17:52 ` [PATCH v4] " SurajSonawane2415
2024-10-09  7:30   ` Christoph Hellwig
2024-10-09 11:00     ` Suraj Sonawane
2024-10-09 11:37       ` Christoph Hellwig
2024-10-09 11:40         ` Suraj Sonawane
2024-11-15 16:07   ` Suraj Sonawane
2024-11-15 16:10     ` Jens Axboe
2024-11-16 11:32       ` Suraj Sonawane
2024-11-18  6:28         ` Christoph Hellwig
2024-11-19 16:53           ` Suraj Sonawane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).