regmap: Fixes for v5.11
A couple of small fixes for leaks when attaching a device to a preexisting regmap. -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl/3OOIACgkQJNaLcl1U h9BHLwf/Q5iRceYjgTZT3EbDqtkf4eX60dwoaoCdSBOtzdzgX1kYdFI2xTeqjMTh sXKTA/OfapyWQrPIWW4vx5jkrum9Wz7hoQJhxp6jLl/lSj2c1TR3U7Nx+b2OA4Ap mPrdlfxHF47jZtsjfPtVUwNyb456ZL94H0IX/kefIUVp8uQusDFBoYLefi+T3+PA cRKlJqpcPpq2amZnXYCRhi8FpFPhFZezfAiddBzpab3xE+RFihgWl9NV2kuk99nR 9SD5ZhoDQF5IQnRXhfHGp2vhXFTk+BgpDuj+TFsF9TkWNgH8gtEQwmskvf7MJFvd Bihwcb8I7Me3ZPE7NI+8YqJEHLXnJg== =2RSs -----END PGP SIGNATURE----- Merge tag 'regmap-fix-v5.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap fixes from Mark Brown: "A couple of small fixes for leaks when attaching a device to a preexisting regmap" * tag 'regmap-fix-v5.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: debugfs: Fix a reversed if statement in regmap_debugfs_init() regmap: debugfs: Fix a memory leak when calling regmap_attach_dev
This commit is contained in:
Коммит
fc37784dc7
|
@ -582,8 +582,12 @@ 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);
|
||||
if (!map->debugfs_name)
|
||||
return;
|
||||
}
|
||||
name = map->debugfs_name;
|
||||
} else {
|
||||
name = devname;
|
||||
|
@ -591,9 +595,10 @@ void regmap_debugfs_init(struct regmap *map)
|
|||
|
||||
if (!strcmp(name, "dummy")) {
|
||||
kfree(map->debugfs_name);
|
||||
|
||||
map->debugfs_name = kasprintf(GFP_KERNEL, "dummy%d",
|
||||
dummy_index);
|
||||
if (!map->debugfs_name)
|
||||
return;
|
||||
name = map->debugfs_name;
|
||||
dummy_index++;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче