lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sun, 30 Jul 2017 11:05:36 +0800
From:   Lu Baolu <baolu.lu@...ux.intel.com>
To:     Greg KH <greg@...ah.com>
Cc:     Mathias Nyman <mathias.nyman@...ux.intel.com>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] usb: xhci: Add debugfs interface for xHCI driver

Hi Greg,


On 07/29/2017 09:34 PM, Greg KH wrote:
> On Sat, Jul 29, 2017 at 04:18:03PM +0800, Lu Baolu wrote:
>> +static void xhci_debugfs_create_files(struct xhci_hcd *xhci,
>> +				      struct xhci_file_map *files,
>> +				      size_t nentries, void *data,
>> +				      struct dentry *parent,
>> +				      const struct file_operations *fops)
>> +{
>> +	int			i;
>> +	struct dentry		*file;
>> +
>> +	for (i = 0; i < nentries; i++) {
>> +		file = debugfs_create_file(files[i].name, 0444,
>> +					   parent, data, fops);
>> +		if (IS_ERR_OR_NULL(file))
>> +			break;
> There's no need to ever check the return value of a debugfs_ function,
> there's nothing you can do here, just keep calling it :)
>
> And you will not get an error, you will only get NULL if there is an
> error, as the only error you would get is if debugfs was not enabled.
>
>> +static struct dentry *xhci_debugfs_create_ring_dir(struct xhci_hcd *xhci,
>> +						   struct xhci_ring *ring,
>> +						   const char *name,
>> +						   struct dentry *parent)
>> +{
>> +	struct dentry		*dir;
>> +
>> +	dir = debugfs_create_dir(name, parent);
>> +	if (IS_ERR_OR_NULL(dir))
>> +		return NULL;
> Same here.  Just keep going, you don't care about the return value, but
> you can use it safely no matter what.
>
>
> Same for other places in this patch as well.

Thanks for review. I will correct them in a v2 patch.

Best regards,
Lu Baolu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ