iio: dummy_evgen: fix possible memleak in evgen init
authorPan Bian <bianpan2016@163.com>
Thu, 18 Apr 2019 03:02:56 +0000 (11:02 +0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 22 Apr 2019 10:45:03 +0000 (11:45 +0100)
commitdfd4f6497614ccb34f822849dd2e1fd2c44de37f
tree4cc3956c8cbcd3f6f8f089bf5f3b76a9eff364a4
parentce7afa5c56c4d0e1a5eefb1d1872d331e893c120
iio: dummy_evgen: fix possible memleak in evgen init

The memory allocated in the function iio_dummy_evgen_create is not
released if it fails to add the evgen device to device hierarchy. This
may result in a memory leak bug.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dummy/iio_dummy_evgen.c