diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2019-05-08 10:32:45 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2019-05-08 10:32:45 +0000 |
commit | 38f38e9fda557e1a5527bb2fb9f4b8b7242011e5 (patch) | |
tree | 406d31d7a343bc79a299d84914871b22d2ec10d0 /sys/ofed | |
parent | 069963d772a5a557cca60ade73c8fd046e7e4d86 (diff) | |
download | src-38f38e9fda557e1a5527bb2fb9f4b8b7242011e5.tar.gz src-38f38e9fda557e1a5527bb2fb9f4b8b7242011e5.zip |
Make sure to error out when arming the CQ fails in ibcore.
MFC after: 3 days
Sponsored by: Mellanox Technologies
Notes
Notes:
svn path=/head/; revision=347257
Diffstat (limited to 'sys/ofed')
-rw-r--r-- | sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c b/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c index 38d3e82f6e58..a644c4d9aeef 100644 --- a/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c +++ b/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c @@ -1692,6 +1692,7 @@ ssize_t ib_uverbs_req_notify_cq(struct ib_uverbs_file *file, { struct ib_uverbs_req_notify_cq cmd; struct ib_cq *cq; + int retval; if (copy_from_user(&cmd, buf, sizeof cmd)) return -EFAULT; @@ -1700,12 +1701,15 @@ ssize_t ib_uverbs_req_notify_cq(struct ib_uverbs_file *file, if (!cq) return -EINVAL; - ib_req_notify_cq(cq, cmd.solicited_only ? - IB_CQ_SOLICITED : IB_CQ_NEXT_COMP); + if (ib_req_notify_cq(cq, cmd.solicited_only ? + IB_CQ_SOLICITED : IB_CQ_NEXT_COMP) < 0) + retval = -ENXIO; + else + retval = in_len; put_cq_read(cq); - return in_len; + return retval; } ssize_t ib_uverbs_destroy_cq(struct ib_uverbs_file *file, |