linux/arch/arm/mach-omap2
Kunwu Chan 1e4f9b7abf ARM: OMAP2+: Fix null pointer dereference and memory leak in omap_soc_device_init
[ Upstream commit c72b9c33ef9695ad7ce7a6eb39a9df8a01b70796 ]

kasprintf() returns a pointer to dynamically allocated memory which can
be NULL upon failure. When 'soc_dev_attr->family' is NULL,it'll trigger
the null pointer dereference issue, such as in 'soc_info_show'.

And when 'soc_device_register' fails, it's necessary to release
'soc_dev_attr->family' to avoid memory leaks.

Fixes: 6770b2114325 ("ARM: OMAP2+: Export SoC information to userspace")
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Message-ID: <20231123145237.609442-1-chentao@kylinos.cn>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-01 12:42:26 +00:00
..
2023-06-22 17:30:09 +02:00
2023-01-09 17:00:54 +01:00
2023-01-09 17:00:54 +01:00
2023-01-09 17:00:54 +01:00
2023-01-09 17:00:54 +01:00
2023-01-09 17:00:54 +01:00
2023-02-20 17:41:08 -08:00
2023-01-09 17:00:54 +01:00
2023-01-09 17:00:54 +01:00
2022-08-04 12:12:54 -07:00
2023-01-09 17:00:54 +01:00
2023-01-09 17:00:54 +01:00
2015-07-16 00:06:05 -07:00
2023-10-07 10:43:04 +03:00
2023-01-09 17:00:54 +01:00
2019-07-19 17:05:08 -07:00
2023-01-09 17:00:54 +01:00
2023-02-20 17:41:08 -08:00
2023-01-09 17:00:54 +01:00
2023-01-09 17:00:54 +01:00
2023-01-09 17:00:54 +01:00
2023-01-09 17:00:54 +01:00
2023-06-02 12:33:48 +03:00
2023-01-09 17:00:54 +01:00
2023-01-09 17:00:54 +01:00
2023-05-31 08:30:43 +03:00
2023-01-09 17:00:54 +01:00
2023-01-09 17:00:54 +01:00
2023-01-09 17:00:54 +01:00
2023-01-09 17:00:54 +01:00