android_kernel_xiaomi_sm7250/drivers/iio/dummy
Xiaoke Wang 00a3e80fa4 iio: dummy: iio_simple_dummy: check the return value of kstrdup()
[ Upstream commit ba93642188a6fed754bf7447f638bc410e05a929 ]

kstrdup() is also a memory allocation-related function, it returns NULL
when some memory errors happen. So it is better to check the return
value of it so to catch the memory error in time. Besides, there should
have a kfree() to clear up the allocation if we get a failure later in
this function to prevent memory leak.

Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Link: https://lore.kernel.org/r/tencent_C920CFCC33B9CC1C63141FE1334A39FF8508@qq.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-14 16:59:36 +02:00
..
iio_dummy_evgen.c iio: dummy_evgen: modify the return value check for irq_sim_init() 2018-01-08 16:03:41 +01:00
iio_dummy_evgen.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iio_simple_dummy_buffer.c iio:dummy: Stop enabling timestamp by default. 2017-01-10 19:54:55 +00:00
iio_simple_dummy_events.c iio: dummy: events: Add missing break 2017-10-01 11:17:18 +01:00
iio_simple_dummy.c iio: dummy: iio_simple_dummy: check the return value of kstrdup() 2022-06-14 16:59:36 +02:00
iio_simple_dummy.h
Kconfig iio:dummy: Add extra paragraphs on Kconfig 2018-03-03 15:20:16 +00:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00