Skip to contentSkip to conversation

swsusp: kill unneeded/unbalanced bio_get

PATCH New Pavel Machek 2 participants 2 messages Feb 5, 2006 – Feb 7, 2006 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 swsusp: kill unneeded/unbalanced bio_get

Takashi pointed out that I don't bio_put in non-error cases, and says bio_get is not neccessary. It still works so I hope he's ok.

kernel/power/swsusp.c +0 -2
@@ -743,7 +743,6 @@ static int submit(int rw, pgoff_t page_o
 	if (!bio)
 		return -ENOMEM;
 	bio->bi_sector = page_off * (PAGE_SIZE >> 9);
-	bio_get(bio);
 	bio->bi_bdev = resume_bdev;
 	bio->bi_end_io = end_io;
 
@@ -762,7 +761,6 @@ static int submit(int rw, pgoff_t page_o
 		yield();
 
  Done:
-	bio_put(bio);
 	return error;
 }
 
Signature · 1 line
Thanks, Sharp!
#2 lore raw

PATCH 1/1 swsusp: kill unneeded/unbalanced bio_get (try 2)

In reply to a message not in the archive

I messed the first attempt up, it only moved leak to error path. Could you replace it with this?

---

Takashi pointed out that I don't bio_put in non-error cases, and says bio_get is not neccessary. It still works so I hope he's ok.

kernel/power/swsusp.c +0 -1
index 59c91c1..c91275e 100644
@@ -743,7 +743,6 @@ static int submit(int rw, pgoff_t page_o
 	if (!bio)
 		return -ENOMEM;
 	bio->bi_sector = page_off * (PAGE_SIZE >> 9);
-	bio_get(bio);
 	bio->bi_bdev = resume_bdev;
 	bio->bi_end_io = end_io;
 
Signature · 1 line
Web maintainer for suspend.sf.net (www.sf.net/projects/suspend) wanted...