lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1482531319-26935-1-git-send-email-khoroshilov@ispras.ru>
Date:   Sat, 24 Dec 2016 01:15:19 +0300
From:   Alexey Khoroshilov <khoroshilov@...ras.ru>
To:     Jonathan Cameron <jic23@...nel.org>,
        Stefan Wahren <stefan.wahren@...e.com>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc:     Alexey Khoroshilov <khoroshilov@...ras.ru>,
        linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
        ldv-project@...uxtesting.org
Subject: [PATCH] iio: mxs-lradc: fix error handling in mxs_lradc_probe()

During transition to using devm_input_allocate_device()
goto to resource deallocation block was replaced by return
in case of error in iio_device_register().
That is wrong since resources are left undeallocated.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@...ras.ru>
Fixes: 962ed43a3eac ("iio: mxs-lradc: remove mxs_lradc_ts_unregister")
---
 drivers/iio/adc/mxs-lradc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/mxs-lradc.c b/drivers/iio/adc/mxs-lradc.c
index b84d37c80a94..1ab0caeb3577 100644
--- a/drivers/iio/adc/mxs-lradc.c
+++ b/drivers/iio/adc/mxs-lradc.c
@@ -1702,7 +1702,7 @@ static int mxs_lradc_probe(struct platform_device *pdev)
 	ret = iio_device_register(iio);
 	if (ret) {
 		dev_err(dev, "Failed to register IIO device\n");
-		return ret;
+		goto err_ts_register;
 	}
 
 	return 0;
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ