Kunwu Chan c72b9c33ef ARM: OMAP2+: Fix null pointer dereference and memory leak in omap_soc_device_init
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>
2023-11-30 13:57:00 +02:00
..
2023-11-03 15:44:25 -10:00
2023-11-10 16:35:04 -08:00
2023-11-04 08:07:19 -10:00
2023-11-03 15:44:25 -10:00
2023-11-12 10:58:08 -08:00
2023-11-01 15:28:33 -10:00
2023-11-10 16:35:04 -08:00
2023-09-05 10:09:31 -07:00
2023-11-12 10:50:38 -08:00
2023-11-03 15:44:25 -10:00