Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933946AbdDGP7r (ORCPT ); Fri, 7 Apr 2017 11:59:47 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:28884 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933783AbdDGP7a (ORCPT ); Fri, 7 Apr 2017 11:59:30 -0400 Subject: Re: [PATCH] RDS: IB: ensure an initialized ret is printed in pr_warn message To: Dan Carpenter , Colin King References: <20170407075723.9669-1-colin.king@canonical.com> <20170407142412.GA4471@mwanda> Cc: "David S . Miller" , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org From: Santosh Shilimkar Organization: Oracle Corporation Message-ID: Date: Fri, 7 Apr 2017 08:59:46 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170407142412.GA4471@mwanda> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 539 Lines: 18 On 4/7/2017 7:24 AM, Dan Carpenter wrote: > Setting it to zero doesn't seem like the right thing, it should be an > error code. Oh, heh... Smatch parses this one correctly. "ret" is > always initialized but the code is probably buggy in a different way: > [...] > 561 ibmr = rds_ib_reg_fmr(rds_ibdev, sg, nents, key_ret); > 562 if (ibmr) > ^^^^ > This condition is always true because those functions return ERR_PTRs > not NULLs. > Thanks Dan. I will fix that up. Regards, Santosh