diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2016-02-07 09:51:24 -0500 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-02-07 23:33:59 +0100 |
commit | da578dac78504aa00d0b0bc1d929c4df63dcf5cd (patch) | |
tree | df1a3cd53af3c235b943293d257f34b722e5249f /libnetfs | |
parent | 987084c1cc955c4368e216e27a3c21de1d524bbf (diff) |
Check for a return value in netfs_make_peropen before using it in netfs_make_protid.
* libnetfs/trans-callback.c: Add check for netfs_make_peropen.
Diffstat (limited to 'libnetfs')
-rw-r--r-- | libnetfs/trans-callback.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libnetfs/trans-callback.c b/libnetfs/trans-callback.c index f4f0c62b..3f1aee6a 100644 --- a/libnetfs/trans-callback.c +++ b/libnetfs/trans-callback.c @@ -58,14 +58,18 @@ _netfs_translator_callback2_fn (void *cookie1, void *cookie2, int flags, struct protid *cred; struct node *node = cookie1; struct iouser *user; + struct peropen *po; err = iohelp_create_simple_iouser (&user, node->nn_stat.st_uid, node->nn_stat.st_gid); if (err) return err; - cred = netfs_make_protid (netfs_make_peropen (node, flags, cookie2), - user); + po = netfs_make_peropen (node, flags, cookie2); + if (! po) + return errno; + + cred = netfs_make_protid (po, user); if (cred) { *underlying = ports_get_right (cred); |