Skip to contentSkip to conversation

potential null dereference in splice code.

PATCH Dave Jones 2 participants 2 messages Apr 3, 2006 – Apr 4, 2006 VFS

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

We can get to out: with a NULL page, which we probably don't want to be calling page_cache_release() on.

fs/splice.c renamed from fs/splice.c~ +2 -1
@@ -445,7 +445,7 @@ find_page:
 		ret = -ENOMEM;
 		page = find_or_create_page(mapping, index, gfp_mask);
 		if (!page)
-			goto out;
+			goto out_nomem;
 
 		/*
 		 * If the page is uptodate, it is also locked. If it isn't
@@ -507,6 +507,7 @@ out:
 		page_cache_release(page);
 		unlock_page(page);
 	}
+out_nomem:
 	buf->ops->unmap(info, buf);
 	return ret;
 }
#1 lore raw
Quoted 2 lines · Dave Jones

We can get to out: with a NULL page, which we probably don't want to be calling page_cache_release() on.

Thanks Dave, applied.

Signature · 1 line
Jens Axboe