]>
Commit | Line | Data |
---|---|---|
7be860c4 GKH |
1 | From foo@baz Mon Sep 17 12:15:09 CEST 2018 |
2 | From: Anton Vasilyev <vasilyev@ispras.ru> | |
3 | Date: Fri, 27 Jul 2018 18:45:36 +0300 | |
4 | Subject: misc: ti-st: Fix memory leak in the error path of probe() | |
5 | ||
6 | From: Anton Vasilyev <vasilyev@ispras.ru> | |
7 | ||
8 | [ Upstream commit 81ae962d7f180c0092859440c82996cccb254976 ] | |
9 | ||
10 | Free resources instead of direct return of the error code if kim_probe | |
11 | fails. | |
12 | ||
13 | Found by Linux Driver Verification project (linuxtesting.org). | |
14 | ||
15 | Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru> | |
16 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
17 | Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> | |
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
19 | --- | |
20 | drivers/misc/ti-st/st_kim.c | 4 ++-- | |
21 | 1 file changed, 2 insertions(+), 2 deletions(-) | |
22 | ||
23 | --- a/drivers/misc/ti-st/st_kim.c | |
24 | +++ b/drivers/misc/ti-st/st_kim.c | |
25 | @@ -757,14 +757,14 @@ static int kim_probe(struct platform_dev | |
26 | err = gpio_request(kim_gdata->nshutdown, "kim"); | |
27 | if (unlikely(err)) { | |
28 | pr_err(" gpio %d request failed ", kim_gdata->nshutdown); | |
29 | - return err; | |
30 | + goto err_sysfs_group; | |
31 | } | |
32 | ||
33 | /* Configure nShutdown GPIO as output=0 */ | |
34 | err = gpio_direction_output(kim_gdata->nshutdown, 0); | |
35 | if (unlikely(err)) { | |
36 | pr_err(" unable to configure gpio %d", kim_gdata->nshutdown); | |
37 | - return err; | |
38 | + goto err_sysfs_group; | |
39 | } | |
40 | /* get reference of pdev for request_firmware | |
41 | */ |