NFS: remove unnecessary test for IS_ERR(cred)
authorNeilBrown <neilb@suse.com>
Wed, 19 Dec 2018 23:29:55 +0000 (10:29 +1100)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 2 Jan 2019 17:05:19 +0000 (12:05 -0500)
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 <dan.carpenter@oracle.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/unlink.c

index a227ab7d68913bfa8728b9a0f6be49a831dabc04..79b97b3c44275af32ea57d73f9fe7948c0551668 100644 (file)
@@ -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;