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: <1406699677-1347-1-git-send-email-pramod.gurav.etc@gmail.com>
Date:	Wed, 30 Jul 2014 11:24:37 +0530
From:	Pramod Gurav <pramod.gurav.etc@...il.com>
To:	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:	Pramod Gurav <pramod.gurav@...rtplayin.com>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Lejun Zhu <lejun.zhu@...ux.intel.com>,
	Sachin Kamat <sachin.kamat@...aro.org>
Subject: [PATCH] input: ads7846: Release resources on failure for clean exit

From: Pramod Gurav <pramod.gurav@...rtplayin.com>

Input device must be released(input_free_device) when ads7846_probe_dt
fails. This fixes the same by releasing resources on failure.

CC: Dmitry Torokhov <dmitry.torokhov@...il.com>
CC: Lejun Zhu <lejun.zhu@...ux.intel.com>
CC: Sachin Kamat <sachin.kamat@...aro.org>

Signed-off-by: Pramod Gurav <pramod.gurav@...rtplayin.com>
---
 drivers/input/touchscreen/ads7846.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index da201b8..e57ba52 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -1302,8 +1302,10 @@ static int ads7846_probe(struct spi_device *spi)
 	pdata = dev_get_platdata(&spi->dev);
 	if (!pdata) {
 		pdata = ads7846_probe_dt(&spi->dev);
-		if (IS_ERR(pdata))
-			return PTR_ERR(pdata);
+		if (IS_ERR(pdata)) {
+			err = PTR_ERR(pdata);
+			goto err_free_mem;
+		}
 	}
 
 	ts->model = pdata->model ? : 7846;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ