Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 May 2019 15:48:56 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r347721 - stable/12/sys/ofed/drivers/infiniband/core
Message-ID:  <201905161548.x4GFmuBA046689@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu May 16 15:48:56 2019
New Revision: 347721
URL: https://svnweb.freebsd.org/changeset/base/347721

Log:
  MFC r347257:
  Make sure to error out when arming the CQ fails in ibcore.
  
  Sponsored by:	Mellanox Technologies

Modified:
  stable/12/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c
==============================================================================
--- stable/12/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c	Thu May 16 15:48:19 2019	(r347720)
+++ stable/12/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c	Thu May 16 15:48:56 2019	(r347721)
@@ -1692,6 +1692,7 @@ ssize_t ib_uverbs_req_notify_cq(struct ib_uverbs_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 
 	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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905161548.x4GFmuBA046689>