]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: wan: framer: pef2256: Switch to devm_mfd_add_devices()
authorHaotian Zhang <vulab@iscas.ac.cn>
Wed, 5 Nov 2025 03:47:16 +0000 (11:47 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 6 Nov 2025 02:02:34 +0000 (18:02 -0800)
commit4d6ec3a7932ca5b168426f7b5b40abab2b41d2da
treece90ed49eee19f6617095ae7e4675096ec220dea
parenta04ea57aae375bdda1cb57034d8bcbb351e1f973
net: wan: framer: pef2256: Switch to devm_mfd_add_devices()

The driver calls mfd_add_devices() but fails to call mfd_remove_devices()
in error paths after successful MFD device registration and in the remove
function. This leads to resource leaks where MFD child devices are not
properly unregistered.

Replace mfd_add_devices with devm_mfd_add_devices to automatically
manage the device resources.

Fixes: c96e976d9a05 ("net: wan: framer: Add support for the Lantiq PEF2256 framer")
Suggested-by: Herve Codina <herve.codina@bootlin.com>
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Acked-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20251105034716.662-1-vulab@iscas.ac.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/wan/framer/pef2256/pef2256.c