History

block: fix memory leak in bio_clone()

If bio_integrity_clone() fails, bio_clone() returns NULL without freeing the newly allocated bio.

Li Zefan committed 17 years ago

Commit 059ea331 parent 87092691 file · +3 −1Browse files

Unified · Split

fs/bio.c+3−1
@@ -465,8 +465,10 @@ struct bio *bio_clone(struct bio *bio, gfp_t gfp_mask) · 464 unmodified lines
465 465
466 ret = bio_integrity_clone(b, bio, gfp_mask, fs_bio_set);466 ret = bio_integrity_clone(b, bio, gfp_mask, fs_bio_set);
467 467
468 if (ret < 0)468 if (ret < 0) {
469 bio_put(b);
469 return NULL;470 return NULL;
471 }
470 }472 }
471 473
472 return b;474 return b;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t