mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
[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 <davej@redhat.com> Signed-off-by: Jens Axboe <axboe@suse.de>
This commit is contained in:
parent
c7f21e4f5a
commit
9aefe431f5
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user