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] [thread-next>] [day] [month] [year] [list]
Message-ID: <0C18FE92A7765D4EB9EE5D38D86A563A05CFE203@shsmsx102.ccr.corp.intel.com>
Date:	Mon, 11 Apr 2016 11:09:39 +0000
From:	"Du, Changbin" <changbin.du@...el.com>
To:	Felipe Balbi <balbi@...nel.org>
CC:	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] usb: dwc3: free dwc->regset on dwc3_debugfs_exit

> > diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c
> > index 9ac37fe..9eeb444 100644
> > --- a/drivers/usb/dwc3/debugfs.c
> > +++ b/drivers/usb/dwc3/debugfs.c
> > @@ -687,4 +687,7 @@ void dwc3_debugfs_exit(struct dwc3 *dwc)
> >  {
> >  	debugfs_remove_recursive(dwc->root);
> >  	dwc->root = NULL;
> > +
> > +	kfree(dwc->regset);
> 
> we also need a kfree() on dwc3_debugfs_init().
This patch is based on the patch set 
[PATCH v3 1/2] usb: dwc3: make dwc3_debugfs_init return value be void> 
So, they do has dependency. :)

> > +	dwc->regset = NULL;
> 
> setting regset to NULL is unnecessary. We only call dwc3_debugfs_exit()
> when removing the driver.
> 
> --
> Balbi
I'd like keep this line even it is unnecessary, because It is a good habit to
Avoid wild pointers. Just like the dwc->root = NULL.

Thanks,
Du, Changbin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ