diff --git a/ipc/mqueue.c b/ipc/mqueue.c index c9ff943f19abc6..eb1391b52c6f84 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -1270,8 +1270,10 @@ static int do_mq_notify(mqd_t mqdes, const struct sigevent *notification) timeo = MAX_SCHEDULE_TIMEOUT; ret = netlink_attachskb(sock, nc, &timeo, NULL); - if (ret == 1) + if (ret == 1) { + sock = NULL; goto retry; + } if (ret) { sock = NULL; nc = NULL;