From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752292AbcLJUGt (ORCPT ); Sat, 10 Dec 2016 15:06:49 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:14785 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751774AbcLJUGr (ORCPT ); Sat, 10 Dec 2016 15:06:47 -0500 X-IronPort-AV: E=Sophos;i="5.33,329,1477954800"; d="scan'208";a="203795387" Date: Sat, 10 Dec 2016 21:06:44 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Dan Carpenter cc: Joe Perches , 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 In-Reply-To: <20161210184029.GY8176@mwanda> Message-ID: References: <20161210090618.GA11680@elgon.mountain> <1481369270.5946.51.camel@perches.com> <20161210184029.GY8176@mwanda> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 10 Dec 2016, Dan Carpenter wrote: > 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. I tried anything that looks like a print, ie has a format string argument, and was taking the address of a local variable as another argument. But there are lots of weird format designators in the kernel that Coccinelle doesn't know about for which passing the address of a local variable is reasonable. So for the moment, there are, as far as I can see, just a lot of false positives. I did add improving the support for format strings to my TODO list. julia > > regards, > dan carpenter > > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >