Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751793AbdIUMom (ORCPT ); Thu, 21 Sep 2017 08:44:42 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:48326 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751581AbdIUMol (ORCPT ); Thu, 21 Sep 2017 08:44:41 -0400 Date: Thu, 21 Sep 2017 13:44:38 +0100 From: Al Viro To: Arvind Yadav Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] debugfs: Add check for module parameter name Message-ID: <20170921124438.GH32076@ZenIV.linux.org.uk> References: <8cf113648f45ccbf304735fcc4487adecd5b7082.1505996056.git.arvind.yadav.cs@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8cf113648f45ccbf304735fcc4487adecd5b7082.1505996056.git.arvind.yadav.cs@gmail.com> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 576 Lines: 12 On Thu, Sep 21, 2017 at 05:46:54PM +0530, Arvind Yadav wrote: > Here, start_creating() is calling by debugfs_create_dir() > and debugfs_create_automount(). driver can pass name as NULL in > debugfs_create_dir and debugfs_create_automount. So we need to > add check for 'name'. Huh? "Driver can pass any kind of crap pointer when calling this function, so let's check if that crap happens to be NULL and bail out in that particular case"? Or am I misreading that? Do you have any in-tree examples, or is that about some out-of-tree code that needs to be saved from itself?