RE: [PATCH v3] regmap: debugfs: Fix a memory leak when calling regmap_attach_dev

From: Wang, Xiaolei
Date: Wed Dec 30 2020 - 07:38:26 EST


Hi Markus

> Thank you very much, very good suggestion,

> Thanks for another positive feedback.


> do I need to re-send a patch to fix this problem, or modify the previous patch and send it again?

> Please convince the involved contributors to integrate a corrected patch version.

Do you mean that I should correct the original patch and explain my changes and send it out?

> * Better indentation.

* …
>> + if (!map->debugfs_name)
>> + kfree(map->debugfs_name);

> Would this questionable null pointer check result in a memory leak?

if (!map->debugfs_name)
kfree(map->debugfs_name);

This null pointer check is not in the memory leak

Thanks
xiaolei
-----Original Message-----
From: Markus Elfring <Markus.Elfring@xxxxxx>
Sent: Wednesday, December 30, 2020 8:02 PM
To: Wang, Xiaolei <Xiaolei.Wang@xxxxxxxxxxxxx>; kernel-janitors@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx; David Lechner <david@xxxxxxxxxxxxxx>; Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>; Mark Brown <broonie@xxxxxxxxxx>; Rafael J. Wysocki <rafael@xxxxxxxxxx>; Julia Lawall <julia.lawall@xxxxxxx>
Subject: Re: [PATCH v3] regmap: debugfs: Fix a memory leak when calling regmap_attach_dev

> Thank you very much, very good suggestion,

Thanks for another positive feedback.


> do I need to re-send a patch to fix this problem, or modify the previous patch and send it again?

Please convince the involved contributors to integrate a corrected patch version.

* Better indentation.

* …
>> + if (!map->debugfs_name)
>> + kfree(map->debugfs_name);

Would this questionable null pointer check result in a memory leak?

Regards,
Markus