summaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/config.py
diff options
context:
space:
mode:
authorMa Ke <make24@iscas.ac.cn>2025-09-20 20:53:12 +0800
committerAndreas Larsson <andreas@gaisler.com>2025-09-22 07:52:35 +0200
commit302c04110f0ce70d25add2496b521132548cd408 (patch)
tree98ad5e50858ce47aa9646726a376b0f3347671d1 /scripts/gdb/linux/config.py
parent936fb512752af349fc30ccbe0afe14a2ae6d7159 (diff)
sparc: fix error handling in scan_one_device()
Once of_device_register() failed, we should call put_device() to decrement reference count for cleanup. Or it could cause memory leak. So fix this by calling put_device(), then the name can be freed in kobject_cleanup(). Calling path: of_device_register() -> of_device_add() -> device_add(). As comment of device_add() says, 'if device_add() succeeds, you should call device_del() when you want to get rid of it. If device_add() has not succeeded, use only put_device() to drop the reference count'. Found by code review. Cc: stable@vger.kernel.org Fixes: cf44bbc26cf1 ("[SPARC]: Beginnings of generic of_device framework.") Signed-off-by: Ma Ke <make24@iscas.ac.cn> Reviewed-by: Andreas Larsson <andreas@gaisler.com> Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Diffstat (limited to 'scripts/gdb/linux/config.py')
0 files changed, 0 insertions, 0 deletions