@@ -481,7 +481,7 @@ static int netfs_read_gaps(struct file *file, struct folio *folio)
struct address_space *mapping = folio->mapping;
struct netfs_folio *finfo = netfs_folio_info(folio);
struct netfs_inode *ctx = netfs_inode(mapping->host);
- struct folio *sink = NULL;
+ struct folio *sink;
struct bio_vec *bvec;
unsigned int from = finfo->dirty_offset;
unsigned int to = from + finfo->dirty_len;
@@ -540,8 +540,7 @@ static int netfs_read_gaps(struct file *file, struct folio *folio)
netfs_read_to_pagecache(rreq);
- if (sink)
- folio_put(sink);
+ folio_put(sink);
ret = netfs_wait_for_read(rreq);
if (ret == 0) {
We can remove the "sink" initialization and the check for NULL. It was already checked for NULL ealier. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> --- fs/netfs/buffered_read.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)