From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752521AbcLJS4F (ORCPT ); Sat, 10 Dec 2016 13:56:05 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:35520 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752067AbcLJS4E (ORCPT ); Sat, 10 Dec 2016 13:56:04 -0500 Date: Sat, 10 Dec 2016 21:55:29 +0300 From: Dan Carpenter To: Joe Perches Cc: James Smart , Keith Busch , Jens Axboe , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [patch] nvme-fabrics: correct some printk information Message-ID: <20161210184029.GY8176@mwanda> References: <20161210090618.GA11680@elgon.mountain> <1481369270.5946.51.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1481369270.5946.51.camel@perches.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 10, 2016 at 03:27:50AM -0800, Joe Perches wrote: > On Sat, 2016-12-10 at 12:06 +0300, Dan Carpenter wrote: > > We really don't care where "ctrl" is on the stack since we're just > > returning soon what we want is the actual ctrl pointer itself. > > > > Signed-off-by: Dan Carpenter > > > > diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c > [] > > @@ -2402,7 +2402,7 @@ enum blk_eh_timer_return > > > > dev_info(ctrl->ctrl.device, > > "NVME-FC{%d}: new ctrl: NQN \"%s\" (%p)\n", > > - ctrl->cnum, ctrl->ctrl.opts->subsysnqn, &ctrl); > > + ctrl->cnum, ctrl->ctrl.opts->subsysnqn, ctrl); > > Found by script or inspection? > > If by script, it seems unlikely there's only 1 instance > where an address of an automatic pointer type is used > incorrectly. Script. But it's using a pretty specific heuristic where we kmalloc a pointer and then pass the address. It prints few warnings. Probably 40% false positives, but the remaining examples of course are 100% false positives. regards, dan carpenter