From patchwork Thu Jul 5 16:38:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arlin Davis X-Patchwork-Id: 1161711 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4ABB6DFB7C for ; Thu, 5 Jul 2012 16:38:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751374Ab2GEQig (ORCPT ); Thu, 5 Jul 2012 12:38:36 -0400 Received: from mga14.intel.com ([143.182.124.37]:28443 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752177Ab2GEQif (ORCPT ); Thu, 5 Jul 2012 12:38:35 -0400 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 05 Jul 2012 09:38:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="119196553" Received: from orsmsx606.amr.corp.intel.com ([10.22.226.128]) by AZSMGA002.ch.intel.com with ESMTP; 05 Jul 2012 09:38:35 -0700 Received: from orsmsx105.amr.corp.intel.com (10.22.225.132) by orsmsx606.amr.corp.intel.com (10.22.226.128) with Microsoft SMTP Server (TLS) id 8.2.255.0; Thu, 5 Jul 2012 09:38:35 -0700 Received: from orsmsx101.amr.corp.intel.com ([169.254.8.125]) by ORSMSX105.amr.corp.intel.com ([169.254.4.138]) with mapi id 14.01.0355.002; Thu, 5 Jul 2012 09:38:34 -0700 From: "Davis, Arlin R" To: "linux-rdma@vger.kernel.org" CC: "ofw@lists.openfabrics.org" Subject: [PATCH 5/7] common: check for valid states during ep posting Thread-Topic: [PATCH 5/7] common: check for valid states during ep posting Thread-Index: AQHNWsye8naUBJP+qEWJ9bKwzJgQ8Q== Date: Thu, 5 Jul 2012 16:38:33 +0000 Message-ID: <54347E5A035A054EAE9D05927FB467F9481A87F4@ORSMSX101.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Signed-off-by: Arlin Davis --- dapl/common/dapl_ep_util.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) -- 1.7.3 diff --git a/dapl/common/dapl_ep_util.c b/dapl/common/dapl_ep_util.c index 5133f59..8ceb1be 100644 --- a/dapl/common/dapl_ep_util.c +++ b/dapl/common/dapl_ep_util.c @@ -352,6 +352,10 @@ dapl_ep_post_send_req(IN DAT_EP_HANDLE ep_handle, ep_ptr = (DAPL_EP *) ep_handle; + if ((ep_ptr->param.ep_state != DAT_EP_STATE_CONNECTED) && + (ep_ptr->param.ep_state != DAT_EP_STATE_DISCONNECTED)) + return(DAT_ERROR(DAT_INVALID_STATE, DAT_INVALID_STATE_EP_UNCONNECTED)); + /* * Synchronization ok since this buffer is only used for send * requests, which aren't allowed to race with each other.