Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp439115imu; Tue, 22 Jan 2019 22:42:41 -0800 (PST) X-Google-Smtp-Source: ALg8bN4JI3+e0Am4sD2cd5VqufSXNDdBOc/EeRJY44TeAxBwQklJSbyqOtl8Cw5GKJfr1njxoSjr X-Received: by 2002:a17:902:1005:: with SMTP id b5mr1067540pla.310.1548225761223; Tue, 22 Jan 2019 22:42:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548225761; cv=none; d=google.com; s=arc-20160816; b=J1wUeqYTuO1TileQrLzkltNJW+EqUrHn9DatGUKPS0jZp8gJMM9ymSYSkhSgqJDrOI GWLWxV/fUP/fZVTgrq0C6zbcvCizP0taUHZzvkl9lDJRFnERKKfiBbFkHmw81ZNtStfP ucB4Js9V43SYMievyoWX890pWC48adhIvaj/vO/VTPjpHU8QwG4QqYuyB7nnjck+Ur7/ J6gRtpaJCD7mBRhWAA/alk3c2m9T2mPCh/J2TVTQOTsGbWL5mg9dYELfoQdShHBfA+IN phrVBY5qbgWkPR3uqD5P5r9FkaERCniEu8neK8zrZhKXjhc0GXATiCDeUtPN2atARI6A CCIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=e3Ut9L2K49g1iHSRtpV9DaA/DIDHUKsIIoOI6PXyRY0=; b=qo6vEYme5fVNPyVeJ3DJwhXNbqhfcnhpItnm8HIxb7bn8sL5yj0nihQTIXwci4Rfdu 8EMK737pv/+2gSQiwCgQUQP/37kweA8FfSZ0NrLf+oCotKiTfqLth9isLsFObimdxdaw oMXLyg/5wTwfnfzvWKaMWxor92WZZTAuuRFNdc88EAOS/eO2FxWDhGm2KduqDAYVMQ9Q rv0VUTdY2jU11oo50AoIl4DDhnuG+F05RA4lkTUBEKj3tBsaM03DQKQRDjgI2D26RUEZ hRZFMO21J/c+uO2AKmQlZWEkOHsZcnvcdabSOwHxg1+poNUYf6k0CGENl4SobeXrvicw t8Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SDsTiLUa; 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 e6si17075854pgd.428.2019.01.22.22.42.25; Tue, 22 Jan 2019 22:42:41 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=SDsTiLUa; 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 S1726218AbfAWGlV (ORCPT + 99 others); Wed, 23 Jan 2019 01:41:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:50254 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbfAWGlV (ORCPT ); Wed, 23 Jan 2019 01:41:21 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 238BD21019; Wed, 23 Jan 2019 06:41:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548225680; bh=w95aomDotNNlRN8BZfBpmxdo3zXnrvA461VFT2+2Xm8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SDsTiLUabxMVs5jpfYIqbxroWxaRQpSz7Jqf95YMji67P3UN/ZFUMvl2vgWoYx35+ cHdEfodg6v1oC4E3Y6jiQbsepmvHwTlFDguFO+ZhFv1wzTM6lnMJIqI3NnVFTXM8GA FrunSAwVVEcabO4UQjXxIp8U2bfhMmPzrOa1V7Us= Date: Wed, 23 Jan 2019 07:41:18 +0100 From: Greg Kroah-Hartman To: Omar Sandoval Cc: linux-kernel@vger.kernel.org, "Ed L. Cashin" , Jens Axboe , linux-block@vger.kernel.org Subject: Re: [PATCH] block: aoe: no need to check return value of debugfs_create functions Message-ID: <20190123064118.GC26046@kroah.com> References: <20190122152151.16139-5-gregkh@linuxfoundation.org> <20190122232933.GC5884@vader> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190122232933.GC5884@vader> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 22, 2019 at 03:29:33PM -0800, Omar Sandoval wrote: > On Tue, Jan 22, 2019 at 04:21:04PM +0100, Greg Kroah-Hartman wrote: > > When calling debugfs functions, there is no need to ever check the > > return value. The function can work or not, but the code logic should > > never do something different based on this. > > > > Cc: "Ed L. Cashin" > > Cc: Jens Axboe > > Cc: linux-block@vger.kernel.org > > Signed-off-by: Greg Kroah-Hartman > > --- > > drivers/block/aoe/aoeblk.c | 13 +------------ > > 1 file changed, 1 insertion(+), 12 deletions(-) > > > > diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c > > index e2c6aae2d636..b602646bfa04 100644 > > --- a/drivers/block/aoe/aoeblk.c > > +++ b/drivers/block/aoe/aoeblk.c > > @@ -207,14 +207,7 @@ aoedisk_add_debugfs(struct aoedev *d) > > else > > p++; > > BUG_ON(*p == '\0'); > > - entry = debugfs_create_file(p, 0444, aoe_debugfs_dir, d, > > - &aoe_debugfs_fops); > > - if (IS_ERR_OR_NULL(entry)) { > > - pr_info("aoe: cannot create debugfs file for %s\n", > > - d->gd->disk_name); > > - return; > > - } > > - BUG_ON(d->debugfs); > > + debugfs_create_file(p, 0444, aoe_debugfs_dir, d, &aoe_debugfs_fops); > > d->debugfs = entry; > > Now entry is uninitialized here when we assign it to d->debugfs. Ah, good catch, I'll go fix this up and post a v2, sorry about that. greg k-h