Skip to content

Commit 5c72e4d

Browse files
committed
Merge branch 'for-7.1/block' into for-next
* for-7.1/block: block: reject zero length in bio_add_page()
2 parents 71c3ee5 + 6438936 commit 5c72e4d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

block/bio.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,8 @@ int bio_add_page(struct bio *bio, struct page *page,
10261026
{
10271027
if (WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED)))
10281028
return 0;
1029+
if (WARN_ON_ONCE(len == 0))
1030+
return 0;
10291031
if (bio->bi_iter.bi_size > BIO_MAX_SIZE - len)
10301032
return 0;
10311033

0 commit comments

Comments
 (0)