[Pkg-ofed-commits] [libfabric] 03/123: prov/psm: fix coverity issue #29730 -- unckecked return value

Ana Beatriz Guerrero López ana at moszumanska.debian.org
Sat Oct 22 12:28:22 UTC 2016


This is an automated email from the git hooks/post-receive script.

ana pushed a commit to annotated tag v1.1.1
in repository libfabric.

commit bbe0ba05d39d2e5da381a2b2a65cd27d7ac92cb3
Author: Jianxin Xiong <jianxin.xiong at intel.com>
Date:   Thu Aug 27 13:53:30 2015 -0700

    prov/psm: fix coverity issue #29730 -- unckecked return value
    
    Signed-off-by: Jianxin Xiong <jianxin.xiong at intel.com>
---
 prov/psm/src/psmx_wait.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/prov/psm/src/psmx_wait.c b/prov/psm/src/psmx_wait.c
index 0a43d61..9145a57 100644
--- a/prov/psm/src/psmx_wait.c
+++ b/prov/psm/src/psmx_wait.c
@@ -242,7 +242,12 @@ static int psmx_wait_init(struct psmx_fid_wait *wait, int type)
 		if (socketpair(AF_UNIX, SOCK_STREAM, 0, wait->fd))
 			return -errno;
 
-		fcntl(wait->fd[0], F_GETFL, &flags);
+		if (fcntl(wait->fd[0], F_GETFL, &flags) == -1) {
+			close(wait->fd[0]);
+			close(wait->fd[1]);
+			return -errno;
+		}
+
 		if (fcntl(wait->fd[0], F_SETFL, flags | O_NONBLOCK)) {
 			close(wait->fd[0]);
 			close(wait->fd[1]);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ofed/libfabric.git



More information about the Pkg-ofed-commits mailing list