From patchwork Wed Jun 22 13:15:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarod Wilson X-Patchwork-Id: 9192755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 440436075A for ; Wed, 22 Jun 2016 13:16:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 349DB283F7 for ; Wed, 22 Jun 2016 13:16:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28FD328406; Wed, 22 Jun 2016 13:16:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24E85283F7 for ; Wed, 22 Jun 2016 13:16:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751537AbcFVNQE (ORCPT ); Wed, 22 Jun 2016 09:16:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50331 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751434AbcFVNQD (ORCPT ); Wed, 22 Jun 2016 09:16:03 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5E8787AE96; Wed, 22 Jun 2016 13:16:02 +0000 (UTC) Received: from hp-dl360pgen8-07.khw.lab.eng.bos.redhat.com (hp-dl360pgen8-07.khw.lab.eng.bos.redhat.com [10.16.184.47]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5MDG1GY016680; Wed, 22 Jun 2016 09:16:01 -0400 From: Jarod Wilson To: linux-rdma@vger.kernel.org Cc: Jarod Wilson , Sean Hefty Subject: [PATCH librdmacm] fix udpong segfault on rconnect error Date: Wed, 22 Jun 2016 09:15:50 -0400 Message-Id: <1466601350-47463-1-git-send-email-jarod@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 22 Jun 2016 13:16:02 +0000 (UTC) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Before patch: [root@rdma-qe-05 librdmacm (master *)]$ udpong -s 172.31.45.4 name bytes xfers total time Gb/sec usec/xfer rconnect: No such file or directory Segmentation fault (core dumped) After patch: [root@rdma-qe-05 librdmacm (master *)]$ ./examples/udpong -s 172.31.45.4 name bytes xfers total time Gb/sec usec/xfer rconnect: No such file or directory Simple fix, just a missing goto on error, so we don't try to do things that are already expected to fail. CC: Sean Hefty Signed-off-by: Jarod Wilson --- examples/udpong.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/udpong.c b/examples/udpong.c index 97713a2..6affc62 100644 --- a/examples/udpong.c +++ b/examples/udpong.c @@ -427,6 +427,7 @@ static int client_connect(void) if (ret) { perror("rconnect"); rs_close(rs); + goto out; } msg.op = msg_op_login;