Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: ads7846 - release resources on failure for clean exit

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

Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Pramod Gurav and committed by
Dmitry Torokhov
a1cd3fd0 9d469d03

+4 -2
+4 -2
drivers/input/touchscreen/ads7846.c
··· 1302 1302 pdata = dev_get_platdata(&spi->dev); 1303 1303 if (!pdata) { 1304 1304 pdata = ads7846_probe_dt(&spi->dev); 1305 - if (IS_ERR(pdata)) 1306 - return PTR_ERR(pdata); 1305 + if (IS_ERR(pdata)) { 1306 + err = PTR_ERR(pdata); 1307 + goto err_free_mem; 1308 + } 1307 1309 } 1308 1310 1309 1311 ts->model = pdata->model ? : 7846;