linux/drivers/iio/dummy
Xiaoke Wang ba93642188 iio: dummy: iio_simple_dummy: check the return value of kstrdup()
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>
2022-04-04 09:11:24 +01:00
..
iio_dummy_evgen.c iio: dummy: iio_dummy_evgen: Demote file header and supply description for 'irq_sim_domain' 2020-09-21 18:41:36 +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: Drop set but unused variable len. 2021-12-21 15:10:09 +00:00
iio_simple_dummy_events.c iio: dummy: iio_simple_dummy_events: Demote file header and supply descriptions for val2 params 2020-07-20 09:02:55 +01:00
iio_simple_dummy.c iio: dummy: iio_simple_dummy: check the return value of kstrdup() 2022-04-04 09:11:24 +01:00
iio_simple_dummy.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
Kconfig iio: dummy: Fix build error when CONFIG_IIO_TRIGGERED_BUFFER is not set 2021-06-13 17:00:17 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00