[<prev] [next>] [day] [month] [year] [list]
Message-ID: <PH0PR11MB507734E4DF73DF015AD601EB95DA0@PH0PR11MB5077.namprd11.prod.outlook.com>
Date: Sun, 27 Dec 2020 12:18:16 +0000
From: "Wang, Xiaolei" <Xiaolei.Wang@...driver.com>
To: Markus Elfring <Markus.Elfring@....de>,
"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Mark Brown <broonie@...nel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>
Subject: RE: [PATCH] regmap: debugfs: fix a memory leak when calling
regmap_attach_dev
Hi Markus
> This should be caused by
> commit <9b947a13e7f6> ("<regmap: use debugfs even when no device>")
> I suggest to omit angle brackets from such information.
> * Will another imperative wording become helpful for the commit description?
> * How do you think about to add the tag “Fixes”?
Do you mean so?
commit:
9b947a13e7f6 ("regmap: use debugfs even when no device")
…
> +++ b/drivers/base/regmap/regmap-debugfs.c
…
> @@ -582,8 +582,10 @@ void regmap_debugfs_init(struct regmap *map)
> devname = dev_name(map->dev);
>
> if (name) {
> - map->debugfs_name = kasprintf(GFP_KERNEL, "%s-%s",
> + if (!map->debugfs_name) {
> + map->debugfs_name = kasprintf(GFP_KERNEL, "%s-%s",
> devname, name);
> + }
…
> I propose to add another null pointer check together with corresponding exception handling.
Which one do you mean by "another null point"? Do you mean that if the call "regmap_debugfs_init" function is repeated, it returns directly?
Regards,
Xiaolei
-----Original Message-----
From: Markus Elfring <Markus.Elfring@....de>
Sent: Saturday, December 26, 2020 10:16 PM
To: Wang, Xiaolei <Xiaolei.Wang@...driver.com>; kernel-janitors@...r.kernel.org
Cc: linux-kernel@...r.kernel.org; Greg Kroah-Hartman <gregkh@...uxfoundation.org>; Mark Brown <broonie@...nel.org>; Rafael J. Wysocki <rafael@...nel.org>
Subject: Re: [PATCH] regmap: debugfs: fix a memory leak when calling regmap_attach_dev
> This should be caused by
> commit <9b947a13e7f6> ("<regmap: use debugfs even when no device>")
I suggest to omit angle brackets from such information.
* Will another imperative wording become helpful for the commit description?
* How do you think about to add the tag “Fixes”?
…
> +++ b/drivers/base/regmap/regmap-debugfs.c
…
> @@ -582,8 +582,10 @@ void regmap_debugfs_init(struct regmap *map)
> devname = dev_name(map->dev);
>
> if (name) {
> - map->debugfs_name = kasprintf(GFP_KERNEL, "%s-%s",
> + if (!map->debugfs_name) {
> + map->debugfs_name = kasprintf(GFP_KERNEL, "%s-%s",
> devname, name);
> + }
…
I propose to add another null pointer check together with corresponding exception handling.
Regards,
Markus
Powered by blists - more mailing lists