Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2485936imm; Thu, 7 Jun 2018 11:24:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKQJfoTL4lWtmgSdZ5epO+pwUgT0+dYzz5xacbmTpgjlDZTsPKLOPeFwzGBS87MrEVChdxN X-Received: by 2002:a63:2505:: with SMTP id l5-v6mr2557262pgl.40.1528395852040; Thu, 07 Jun 2018 11:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528395852; cv=none; d=google.com; s=arc-20160816; b=VgstRvUH/kHQSd2ynenOtIH3w4NFfNq1dk7GfbepPW8cAvvgdHDLd53t3i4tE863bu LVtRJSIwwYinpJgwC0pt41rwKIm6utdQhJvnTSiYfUBjlc4bMjjtOH/PFU1W7otBLPyk Xy6Q115CEwlmFdle2Tm7AcPU2CqanKEfoRv700iiLGS6EWVpjrYK4VkDH8PS10nw6+J1 caGymn072X6zaYS1zaP38gEAorpwgqQRuMXxrzvVkNt1WlvceDg67gTgZhr0cufHPTl6 GDkrNSQh57vyv+J2ozDriLT6ajbDz9ctqTE3+gJ28TQqZIYsRO0CAt+9+OpZ23OMvgDB kzaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=A+VTyxEcQBNefFEU0hm09sMFLUC9pFLx2FwPF+Wmyo0=; b=TMQ2BHM7vgLeAUEn4lHiGZ/BPIWZ9Lqy5Z0sCTQyq/Rvnq/KerHsZ6eQb20CLGaDOT kNy57ZI4HRonvp0Mz8gsxPSCr94JRak+g+p+/BJkMTPMMx3XyY8REYYJ9BG9UM5ujojP TOxVgpsgXmE59yu6IBbvp8MX2qIo0cUkvrBZgmQmHSM8lJFs55CvtpMN/lyiJB8afOte 9G0YT1itnaV/jDs9pKCpPAkRBWzwPi381iSMxtHuEPkB8KU5M+ArkbKlRi58A9/US+w6 XDb2Ox31GyUxQXWaTsxMOS09a+UfSTn5WzwK1b4C1dMLvJ5QQxv/WIRRTC09LTsIQ3GH O1nQ== 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 v16-v6si38147934plo.186.2018.06.07.11.23.57; Thu, 07 Jun 2018 11:24:12 -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 S965076AbeFGPKF (ORCPT + 99 others); Thu, 7 Jun 2018 11:10:05 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:41498 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933515AbeFGPDP (ORCPT ); Thu, 7 Jun 2018 11:03:15 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbs-0005hL-M6; Thu, 07 Jun 2018 15:09:52 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvb0-0002nu-Nt; Thu, 07 Jun 2018 15:08:58 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Geert Uytterhoeven" , "Jason Gunthorpe" , "Tatyana Nikolova" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 083/410] RDMA/iwpm: Fix uninitialized error code in iwpm_send_mapinfo() In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Geert Uytterhoeven commit 302d6424e4a293a5761997e6c9fc3dfb1e4c355f upstream. With gcc-4.1.2: drivers/infiniband/core/iwpm_util.c: In function ‘iwpm_send_mapinfo’: drivers/infiniband/core/iwpm_util.c:647: warning: ‘ret’ may be used uninitialized in this function Indeed, if nl_client is not found in any of the scanned has buckets, ret will be used uninitialized. Preinitialize ret to -EINVAL to fix this. Fixes: 30dc5e63d6a5ad24 ("RDMA/core: Add support for iWARP Port Mapper user space service") Signed-off-by: Geert Uytterhoeven Reviewed-by: Tatyana Nikolova Signed-off-by: Jason Gunthorpe [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- drivers/infiniband/core/iwpm_util.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/infiniband/core/iwpm_util.c +++ b/drivers/infiniband/core/iwpm_util.c @@ -513,6 +513,7 @@ int iwpm_send_mapinfo(u8 nl_client, int } skb_num++; spin_lock_irqsave(&iwpm_mapinfo_lock, flags); + ret = -EINVAL; for (i = 0; i < IWPM_HASH_BUCKET_SIZE; i++) { hlist_for_each_entry(map_info, &iwpm_hash_bucket[i], hlist_node) {