Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7606879imu; Tue, 22 Jan 2019 08:35:45 -0800 (PST) X-Google-Smtp-Source: ALg8bN4s8RO9BoTAtvZsmzUPUK27nU7OMPQQPoTAPpPqQkAfACnyvl0EusYGdEaJjalEgtWy98C0 X-Received: by 2002:aa7:81d0:: with SMTP id c16mr33863999pfn.153.1548174945019; Tue, 22 Jan 2019 08:35:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548174944; cv=none; d=google.com; s=arc-20160816; b=VG65s29JNCbil3QbHar+OtWkVH343dmTP+kKxbR8PK0qqWJnZeN+1hASzHk7jKOlGr gdVK9jBlLOxompKDAtnLFE0qYnRg6lh+HEtKeiN4EeF8LiZqbPynnOgoqjohQlBImG1J ykdkfBN55PbFD3oDU+JVLwLSI5gBq+plp/kGaZkixqDEfD9CE1j9kCDJzWSZM3Au+KGk 99n6iXKS/uRQ9KMqrrPkcigOIIFpPJ2bvA7SRPvLp+AIdJcVuRp1z5CU34b9g3xZszEK qWwBIStlobSYtmANU8SnK8Fsoz6Q6R914BBNXYI8QILPrN2VGYGRpA9yDCQTIbulLfGZ 0reg== 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=rMHiMDeHkPzlUU0lNHWuPEXPRBD4IXwu9LLbmFLBEnA=; b=Lg+JtVnqupuQSA1UveYGgyHr27YxG9KBt18upXL1GykbZsppcPZiWWsL0TtpS863UG QkIoYBL7dRsTVgnPT0zcqBCvKf4bvHqoieo49wynXgDZjFnBRLc92XO/khlMQWXv0IPB E+HBqxyXJIz4qIRt+LK6Ul2corICibJOPJkmv8bd0mgdEXteJjZVj8zUFO7jfksSKikU Xm+7foOZO+ob8uBsSBtOq+kdZAv/9Pik8l0W5cBCJLLkXImNacigFfu3NMZ8NY/5b4O7 lNjDoYb3G37PTjcjI9v6oQFdYB/vwGQ0L9JmqhsQQyOClq21eO7+pGB0h89W7IMkjGlC rWhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gDtJRck8; 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 i1si11833339pgs.417.2019.01.22.08.35.29; Tue, 22 Jan 2019 08:35:44 -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=gDtJRck8; 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 S1729336AbfAVQdk (ORCPT + 99 others); Tue, 22 Jan 2019 11:33:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:55770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728798AbfAVQdk (ORCPT ); Tue, 22 Jan 2019 11:33:40 -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 22F5B2085A; Tue, 22 Jan 2019 16:33:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548174819; bh=KrqiZ7eaLk6N9ZRrNc+4aLvnPl8tPoB9qjEZK7JEJAE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gDtJRck8Zp8t0vRwdDLmSnBWcQYQnGqstKWITdYUJO1s8jv3828tbZBDuvXPoElLS /3kBF6d53G/0wWLdBjNp6EfQ2qsbJqn5htRJtjOxLREUloQl8q+n1TpmHnzwPT5C00 TBxpEFuymt+kPYZDo2XcbhG4Wuq6Sdc3ob4tuX4M= Date: Tue, 22 Jan 2019 17:33:37 +0100 From: Greg Kroah-Hartman To: Heiko Carstens Cc: linux-kernel@vger.kernel.org, Martin Schwidefsky , Kees Cook , Christian Borntraeger , Hendrik Brueckner , linux-s390@vger.kernel.org Subject: Re: [PATCH] s390: kernel: no need to check return value of debugfs_create functions Message-ID: <20190122163337.GB23510@kroah.com> References: <20190122152151.16139-3-gregkh@linuxfoundation.org> <20190122162454.GA31034@osiris> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190122162454.GA31034@osiris> 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 05:24:54PM +0100, Heiko Carstens wrote: > On Tue, Jan 22, 2019 at 04:21:02PM +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: Martin Schwidefsky > > Cc: Heiko Carstens > > Cc: Kees Cook > > Cc: Christian Borntraeger > > Cc: Hendrik Brueckner > > Cc: linux-s390@vger.kernel.org > > Signed-off-by: Greg Kroah-Hartman > > --- > > arch/s390/kernel/debug.c | 6 ------ > > arch/s390/kernel/kdebugfs.c | 2 -- > > arch/s390/kernel/sysinfo.c | 2 -- > > 3 files changed, 10 deletions(-) > > diff --git a/arch/s390/kernel/sysinfo.c b/arch/s390/kernel/sysinfo.c > > index 12f80d1f0415..2ac3c9b56a13 100644 > > --- a/arch/s390/kernel/sysinfo.c > > +++ b/arch/s390/kernel/sysinfo.c > > @@ -545,8 +545,6 @@ static __init int stsi_init_debugfs(void) > > int lvl, i; > > > > stsi_root = debugfs_create_dir("stsi", arch_debugfs_dir); > > - if (IS_ERR_OR_NULL(stsi_root)) > > - return 0; > > No objections, however will you also change the odd behaviour that > e.g. debugfs_create_file() returns -ENODEV instead of (the expected) > NULL pointer if CONFIG_DEBUGFS is disabled? Nope. That is intentional. > I do remember this since it caused at least one crash ;) Which is why you shouldn't care about the return value of these functions :) > 19cdd08ba155 ("[S390] qdio: fix broken pointer in case of CONFIG_DEBUG_FS is disabled"). Odd, what crashes when passed an error pointer? What was someone trying to do with those pointers? The only thing you can do with a return value from a debugfs function is to pass it back into another debugfs call. Sounds like someone wasn't doing that :( Given that that patch was from 2.6.29, I think we are safe... thanks, greg k-h