From: NeilBrown Date: Wed, 19 Dec 2018 23:29:55 +0000 (+1100) Subject: NFS: remove unnecessary test for IS_ERR(cred) X-Git-Tag: v5.15~7262^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c2c7d84fd173aff121ffd45cf15277eff43348d3;p=platform%2Fkernel%2Flinux-starfive.git NFS: remove unnecessary test for IS_ERR(cred) As gte_current_cred() cannot return an error, this test is not necessary. It hasn't been necessary for years, but it wasn't so obvious before. Reported-by: Dan Carpenter Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker --- diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c index a227ab7..79b97b3 100644 --- a/fs/nfs/unlink.c +++ b/fs/nfs/unlink.c @@ -348,11 +348,6 @@ nfs_async_rename(struct inode *old_dir, struct inode *new_dir, task_setup_data.callback_data = data; data->cred = get_current_cred(); - if (IS_ERR(data->cred)) { - struct rpc_task *task = ERR_CAST(data->cred); - kfree(data); - return task; - } msg.rpc_argp = &data->args; msg.rpc_resp = &data->res;