don't leak grant on error corner case

fix a small code change where a grant would get leaked.
This commit is contained in:
Ilja van Sprundel 2019-10-04 12:38:54 +02:00 committed by GitHub
parent ad9475f6bf
commit 02d84e8433
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -141,11 +141,11 @@ static int ds_retrieve_raw(const char *ds_name, char *vaddr, size_t *length,
m.m_ds_req.val_len = *length;
m.m_ds_req.flags = flags;
r = do_invoke_ds(&m, DS_RETRIEVE, ds_name);
cpf_revoke(gid);
if (m.m_ds_reply.val_len > *length) {
return EINVAL;
}
*length = m.m_ds_reply.val_len;
cpf_revoke(gid);
return r;
}