Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752653AbcLCN6w (ORCPT ); Sat, 3 Dec 2016 08:58:52 -0500 Received: from m50-134.163.com ([123.125.50.134]:49495 "EHLO m50-134.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751418AbcLCN6v (ORCPT ); Sat, 3 Dec 2016 08:58:51 -0500 From: Pan Bian To: Selvin Xavier , Devesh Sharma , Mitesh Ahuja , Doug Ledford , Sean Hefty , Hal Rosenstock Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Pan Bian Subject: [PATCH 1/1] infiniband: hw: ocrdma: fix bad initialization Date: Sat, 3 Dec 2016 21:10:21 +0800 Message-Id: <1480770621-6249-1-git-send-email-bianpan201602@163.com> X-Mailer: git-send-email 1.9.1 X-CM-TRANSID: DtGowABXfy89xEJY7iUyIg--.16916S3 X-Coremail-Antispam: 1Uf129KBjvdXoWrurWxJw17JryDGry5CF15Jwb_yoWDZFcE9F 48Xryxurn09F1Fkr1vgFWavr97tryjqF1DAw18t393C348G3ZIywn2gFn5W3W3Z3Z7JFsx ArsYyry8GFW5KjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUYqksDUUUUU== X-Originating-IP: [222.131.246.88] X-CM-SenderInfo: held01tdqsiiqwqsqiywtou0bp/xtbBlwE14FSISk3C9QAAsv Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 986 Lines: 30 From: Pan Bian In function ocrdma_mbx_create_ah_tbl(), returns the value of status on errors. However, because status is initialized with 0, 0 will be returned even if on error paths. This patch initialize status with "-ENOMEM". Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188831 Signed-off-by: Pan Bian --- drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c index 67fc0b6..6876a71 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c @@ -1642,7 +1642,7 @@ static int ocrdma_build_q_conf(u32 *num_entries, int entry_size, static int ocrdma_mbx_create_ah_tbl(struct ocrdma_dev *dev) { int i; - int status = 0; + int status = -ENOMEM; int max_ah; struct ocrdma_create_ah_tbl *cmd; struct ocrdma_create_ah_tbl_rsp *rsp; -- 1.9.1