From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753837AbdLMSTr (ORCPT ); Wed, 13 Dec 2017 13:19:47 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:37480 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753818AbdLMSTo (ORCPT ); Wed, 13 Dec 2017 13:19:44 -0500 X-Google-Smtp-Source: ACJfBov1QYinLuzPJ+Ohcax4oVNadQPForkogwU90Xas0cx36UsCF0WAeSPwcmBaQe5kRrOZCJ+34w== Date: Wed, 13 Dec 2017 11:19:39 -0700 From: Jason Gunthorpe To: Geert Uytterhoeven Cc: Tatyana Nikolova , Roland Dreier , Doug Ledford , Arnd Bergmann , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [v2] RDMA/iwpm: Fix uninitialized error code in iwpm_send_mapinfo() Message-ID: <20171213181939.GC5984@ziepe.ca> References: <1511945253-29296-1-git-send-email-geert@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1511945253-29296-1-git-send-email-geert@linux-m68k.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 29, 2017 at 09:47:33AM +0100, Geert Uytterhoeven wrote: > 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 > v2: > - Use -EINVAL instead of zero, > - Move the preinitialization to just before the loop, to catach future > early offenders, > - Drop RFC state. > drivers/infiniband/core/iwpm_util.c | 1 + > 1 file changed, 1 insertion(+) Thanks applied to -next. Jason