From patchwork Tue Dec 1 22:19:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chien Tung X-Patchwork-Id: 64057 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB1MJlFM031857 for ; Tue, 1 Dec 2009 22:19:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753523AbZLAWTm (ORCPT ); Tue, 1 Dec 2009 17:19:42 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753585AbZLAWTm (ORCPT ); Tue, 1 Dec 2009 17:19:42 -0500 Received: from mga14.intel.com ([143.182.124.37]:30492 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753523AbZLAWTm (ORCPT ); Tue, 1 Dec 2009 17:19:42 -0500 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 01 Dec 2009 14:19:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.47,316,1257148800"; d="scan'208";a="217648644" Received: from ctung-mobl.amr.corp.intel.com (HELO ctung-MOBL.intel.com) ([10.232.237.216]) by azsmga001.ch.intel.com with SMTP; 01 Dec 2009 14:19:47 -0800 Received: by ctung-MOBL.intel.com (sSMTP sendmail emulation); Tue, 01 Dec 2009 16:19:46 -0600 Date: Tue, 1 Dec 2009 16:19:46 -0600 From: Chien Tung To: Roland Dreier Cc: linux-rdma@vger.kernel.org Subject: [PATCH 2/9] RDMA/nes: In nes_post_recv() always set bad_wr on error Message-ID: <20091201221946.GA7076@ctung-MOBL> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c index 25b52d2..0b17c01 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.c +++ b/drivers/infiniband/hw/nes/nes_verbs.c @@ -3554,8 +3554,10 @@ static int nes_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr, u32 counter; u32 total_payload_length; - if (nesqp->ibqp_state > IB_QPS_RTS) - return -EINVAL; + if (nesqp->ibqp_state > IB_QPS_RTS) { + err = -EINVAL; + goto out; + } spin_lock_irqsave(&nesqp->lock, flags); @@ -3618,6 +3620,7 @@ static int nes_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr, spin_unlock_irqrestore(&nesqp->lock, flags); +out: if (err) *bad_wr = ib_wr; return err;