Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4610710imm; Tue, 7 Aug 2018 04:36:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfU1z2CbWPwVeISPGh2xH8ntfJVb3lkPytFjfrZPnhzDpE5wdYzraARTcyrstYd8XI2n6Z9 X-Received: by 2002:a17:902:bd4a:: with SMTP id b10-v6mr17629269plx.209.1533641803226; Tue, 07 Aug 2018 04:36:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533641803; cv=none; d=google.com; s=arc-20160816; b=aU0FDnbag5v8mI1H+JfFRBCtIp91lFkMRwNlJNx1EKhQN0gqzF5J7PCBdYUl1m7812 0PMjTV9Q4e723Dd6/osl1R7z+XUQvXgQmEZMrelgE8LHxzT/tYMHItW0OECa0lF+lOta XBt7/iCP4SvminVwDBWetrEQLls6UfBbfRAkNkOiAG6h9yq4v07YOYZdP4w517C9DYk/ pEb0B5mq1AkDA7oBWMqzeb89VE/vKRQFuvOUf1O8AtNG6Cn2xL3Dztp8waI9jZ7Jdbq7 qPNzBuph/H0ZMfWZmh3w7KBMktzHM1Yq8fpTd+Q5QJnOrQl0Jo7+Ap1eopNgP8E3o8Cc q4xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=hzJsYf4QJYuDIArQxoq4r0zhhIgU5hb0cTpENukOZYc=; b=Dob13RXJQSMeaM2QA1t0k59V6Kwk655CNuek2AYh/jcOgOn/Df5iBn79mey+kl+l1K w1mlVBGo7PWlZSScwurW+mWPqmYt04Z3xHQ/SVTYFe8oDIHSQSp+bWVvBmomI0wOV0Xk lz9xqsb2U8DfvzAAgBPbMoJMtyfrGY/mdZht8MjRyarDfvXqsMFlsLiWdIldsrczXl7x TC/+fcy+um2cNGQ8+SRkCdYPxOR9XKRsVcObWIU595f7Yi1rIAEtt078j5zulG/M2KKA MgO6SjgfLneE7PJGJGPY34HBzCgZA4vMBKi6s7x5GDeKYJ8o7pEIgilOnocsLFYia4NF OCLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b35-v6si1252908pgl.562.2018.08.07.04.36.28; Tue, 07 Aug 2018 04:36:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388658AbeHGNtB (ORCPT + 99 others); Tue, 7 Aug 2018 09:49:01 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:10674 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726555AbeHGNtB (ORCPT ); Tue, 7 Aug 2018 09:49:01 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id E421691B3E82F; Tue, 7 Aug 2018 19:35:03 +0800 (CST) Received: from localhost (10.177.31.96) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.399.0; Tue, 7 Aug 2018 19:34:54 +0800 From: YueHaibing To: , CC: , , , , YueHaibing Subject: [PATCH net-next] RDS: IB: fix 'passing zero to ERR_PTR()' warning Date: Tue, 7 Aug 2018 19:34:16 +0800 Message-ID: <20180807113416.12680-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.177.31.96] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix a static code checker warning: net/rds/ib_frmr.c:82 rds_ib_alloc_frmr() warn: passing zero to 'ERR_PTR' The error path for ib_alloc_mr failure should set err to PTR_ERR. Fixes: 1659185fb4d0 ("RDS: IB: Support Fastreg MR (FRMR) memory registration mode") Signed-off-by: YueHaibing --- net/rds/ib_frmr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/rds/ib_frmr.c b/net/rds/ib_frmr.c index b371cf0..6431a02 100644 --- a/net/rds/ib_frmr.c +++ b/net/rds/ib_frmr.c @@ -61,6 +61,7 @@ static struct rds_ib_mr *rds_ib_alloc_frmr(struct rds_ib_device *rds_ibdev, pool->fmr_attr.max_pages); if (IS_ERR(frmr->mr)) { pr_warn("RDS/IB: %s failed to allocate MR", __func__); + err = PTR_ERR(frmr->mr); goto out_no_cigar; } -- 2.7.0