afs: passing an ERR_PTR() to page_cache_release()
Subsystems (2)
PATCH 1/1 afs: passing an ERR_PTR() to page_cache_release()
In the error handling we try to release "page" if it's not NULL.
Signed-off-by Dan Carpenter <[email protected]>
fs/afs/mntpt.c +1 -0
@@ -165,6 +165,7 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt) page =read_mapping_page (mntpt->d_inode->i_mapping,0 ,NULL );if (IS_ERR (page)) { ret =PTR_ERR (page); + page =NULL ; goto error; }
David Howells
maintainerQuoted 1 line · Dan Carpenter
In the error handling we try to release "page" if it's not NULL.
A better way to do this is to add another goto label and skip that bit of the error handling.
David