linux/arch/arm/mach-omap2
Kunwu Chan 930a61fd79 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:38:53 +00:00
..
2021-01-26 13:43:17 +02:00
2022-08-04 12:12:54 -07:00
2015-07-16 00:06:05 -07:00
2022-08-02 08:02:59 -07:00
2019-07-19 17:05:08 -07:00
2020-09-24 14:26:20 +03:00
2020-09-24 14:26:20 +03:00
2020-04-21 09:41:53 -07:00
2019-07-19 17:05:08 -07:00
2021-04-26 11:48:26 -07:00
2022-04-22 11:08:55 +02:00