Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754799AbdDGH5i (ORCPT ); Fri, 7 Apr 2017 03:57:38 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:43704 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753045AbdDGH53 (ORCPT ); Fri, 7 Apr 2017 03:57:29 -0400 From: Colin King To: Santosh Shilimkar , "David S . Miller" , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] RDS: IB: ensure an initialized ret is printed in pr_warn message Date: Fri, 7 Apr 2017 08:57:23 +0100 Message-Id: <20170407075723.9669-1-colin.king@canonical.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 903 Lines: 28 From: Colin Ian King There is a path where ibmr is null and ret has not been initialized and hence a pr_warn message is printing an uninitialized value in ret. Fix this by initializing ret to zero. Detected by CoverityScan, CID#1357946 ("Uninitialized scalar variable") Signed-off-by: Colin Ian King --- net/rds/ib_rdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c index 977f69886c00..4fd637491dd5 100644 --- a/net/rds/ib_rdma.c +++ b/net/rds/ib_rdma.c @@ -542,7 +542,7 @@ void *rds_ib_get_mr(struct scatterlist *sg, unsigned long nents, struct rds_ib_device *rds_ibdev; struct rds_ib_mr *ibmr = NULL; struct rds_ib_connection *ic = rs->rs_conn->c_transport_data; - int ret; + int ret = 0; rds_ibdev = rds_ib_get_device(rs->rs_bound_addr); if (!rds_ibdev) { -- 2.11.0