diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-10-27 11:00:19 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-10-27 11:00:19 -0700 |
commit | 728d90bdc9e480dc93913e59a0aa3c896c7aa697 (patch) | |
tree | 258b1b6ee711f0ef67fd225700d84eccec285194 /ipc/mqueue.c | |
parent | cb3efd5a38855eabd26c2b631dd027169678d60f (diff) | |
parent | d6d5df1db6e9d7f8f76d2911707f7d5877251b02 (diff) | |
download | linux-728d90bdc9e480dc93913e59a0aa3c896c7aa697.tar.bz2 |
Merge tag 'v5.4-rc5' into next
Sync up with mainline.
Diffstat (limited to 'ipc/mqueue.c')
-rw-r--r-- | ipc/mqueue.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 7a5a8edc3de3..3d920ff15c80 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -364,8 +364,7 @@ static int mqueue_get_tree(struct fs_context *fc) { struct mqueue_fs_context *ctx = fc->fs_private; - fc->s_fs_info = ctx->ipc_ns; - return vfs_get_super(fc, vfs_get_keyed_super, mqueue_fill_super); + return get_tree_keyed(fc, mqueue_fill_super, ctx->ipc_ns); } static void mqueue_fs_context_free(struct fs_context *fc) @@ -1241,15 +1240,14 @@ static int do_mq_notify(mqd_t mqdes, const struct sigevent *notification) /* create the notify skb */ nc = alloc_skb(NOTIFY_COOKIE_LEN, GFP_KERNEL); - if (!nc) { - ret = -ENOMEM; - goto out; - } + if (!nc) + return -ENOMEM; + if (copy_from_user(nc->data, notification->sigev_value.sival_ptr, NOTIFY_COOKIE_LEN)) { ret = -EFAULT; - goto out; + goto free_skb; } /* TODO: add a header? */ @@ -1265,8 +1263,7 @@ retry: fdput(f); if (IS_ERR(sock)) { ret = PTR_ERR(sock); - sock = NULL; - goto out; + goto free_skb; } timeo = MAX_SCHEDULE_TIMEOUT; @@ -1275,11 +1272,8 @@ retry: sock = NULL; goto retry; } - if (ret) { - sock = NULL; - nc = NULL; - goto out; - } + if (ret) + return ret; } } @@ -1334,7 +1328,8 @@ out_fput: out: if (sock) netlink_detachskb(sock, nc); - else if (nc) + else +free_skb: dev_kfree_skb(nc); return ret; |