[PATCH] splice: potential !page dereference
authorDave Jones <davej@redhat.com>
Mon, 10 Apr 2006 07:02:40 +0000 (09:02 +0200)
committerJens Axboe <axboe@suse.de>
Mon, 10 Apr 2006 07:02:40 +0000 (09:02 +0200)
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 <davej@redhat.com>
Signed-off-by: Jens Axboe <axboe@suse.de>
fs/splice.c

index b450acdff3975e86713e87df718e57ca74f0d7b9..26f5f7ecee5c3745e3c0a9475109ecc6afeed2f5 100644 (file)
@@ -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;
 }