From: Dave Jones Date: Mon, 10 Apr 2006 07:02:40 +0000 (+0200) Subject: [PATCH] splice: potential !page dereference X-Git-Tag: v2.6.17-rc2~107^2~18 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9aefe431f5a000884db7ae74ac208de814fe5913;p=linux-2.6 [PATCH] splice: potential !page dereference We can get to out: with a NULL page, which we probably don't want to be calling page_cache_release() on. Signed-off-by: Dave Jones Signed-off-by: Jens Axboe --- diff --git a/fs/splice.c b/fs/splice.c index b450acdff3..26f5f7ecee 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -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 @@ -508,6 +508,7 @@ out: page_cache_release(page); unlock_page(page); } +out_nomem: buf->ops->unmap(info, buf); return ret; }