Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752423AbcDKIIo (ORCPT ); Mon, 11 Apr 2016 04:08:44 -0400 Received: from mga02.intel.com ([134.134.136.20]:53676 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751162AbcDKIIl (ORCPT ); Mon, 11 Apr 2016 04:08:41 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,462,1455004800"; d="asc'?scan'208";a="782306057" From: Felipe Balbi To: changbin.du@intel.com Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, "Du\, Changbin" Subject: Re: [PATCH] usb: dwc3: free dwc->regset on dwc3_debugfs_exit In-Reply-To: <1460108522-31664-1-git-send-email-changbin.du@intel.com> References: <1460108522-31664-1-git-send-email-changbin.du@intel.com> User-Agent: Notmuch/0.21+96~g9bbc54b (http://notmuchmail.org) Emacs/25.0.90.3 (x86_64-pc-linux-gnu) Date: Mon, 11 Apr 2016 11:06:20 +0300 Message-ID: <87bn5gpo1v.fsf@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1978 Lines: 62 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable changbin.du@intel.com writes: > From: "Du, Changbin" > > dwc->regset is allocated on dwc3_debugfs_init, and should > be released on dwc3_debugfs_exit. > > Signed-off-by: Du, Changbin > --- > This patch is seperated from patch set: > [PATCH v2 0/3] Improvement, fix and new entry for dwc3 debugfs > Because it is not related to other 2 patches. > > --- > drivers/usb/dwc3/debugfs.c | 3 +++ > 1 file changed, 3 insertions(+) > > 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 =3D NULL; > + > + kfree(dwc->regset); we also need a kfree() on dwc3_debugfs_init(). > + dwc->regset =3D NULL; setting regset to NULL is unnecessary. We only call dwc3_debugfs_exit() when removing the driver. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXC1r8AAoJEIaOsuA1yqREr5sP/107Amka7iGrU3Lmi7t2B8Dx j2i8fwwVZtRAf4UllW7XLOmmpUAameq+w+xOaTzGiDK65uzXRcQSlv2EfH5hNs4k Sk0bhYtqIq6PrtVay8LZXclyVhyc7P6WIYEmApCZ+ExpAEsqu7zJtNVoScV+2Hkf FH81QY04pKxahe55SMZlxFgUWAMsyYJZRUO8XUts8dkB1lqs83vlj8fTwFoPGwVU k0vFLe4HM+mZ1e9FZ7jDctn11hC1IfWn4L5CNCrWOZp+ehbdHOg/xY9lKDOJEdSA Lgttr203vo/LcZ6a4LxrquxWT7ZLbzNX+G0xdRqto6DSYX4lXkfuRobLOCSQBGIT eExEnO38dRKolZJXlErMmgx6Gv8DaN5iPBhk8Frv5DoosES0fvfog8guGHhexVgI RjDM02sJsAx4+vTrcM1NM4ybpXUueaAiCsG2qR81UqFTMslT+o2Zx7zUyltr5DNU uaQaHh5bBYewk9hfRpEDSOxGiYN/tjsEupI9mgKnto8iY+uHawRdHsoUrU/cwaiz s/Zg1Kf+llmw9zYoVkBwyy8Fe39Vf9VJwFuUvzWhnJrc7sRACXEYOUXBl5UhREQl mKSZLI9TwFNwOqcR/WRSlrXX1pKSUNj//m8RZ782O2QqNW9gMbI4y2kanDvJ/A/K 5zOl5TaD0/cRVn/hlnH7 =my3y -----END PGP SIGNATURE----- --=-=-=--