Skip to content

Commit 81ae962

Browse files
Druidosgregkh
authored andcommitted
misc: ti-st: Fix memory leak in the error path of probe()
Free resources instead of direct return of the error code if kim_probe fails. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c8c64b3 commit 81ae962

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/misc/ti-st/st_kim.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,14 +755,14 @@ static int kim_probe(struct platform_device *pdev)
755755
err = gpio_request(kim_gdata->nshutdown, "kim");
756756
if (unlikely(err)) {
757757
pr_err(" gpio %d request failed ", kim_gdata->nshutdown);
758-
return err;
758+
goto err_sysfs_group;
759759
}
760760

761761
/* Configure nShutdown GPIO as output=0 */
762762
err = gpio_direction_output(kim_gdata->nshutdown, 0);
763763
if (unlikely(err)) {
764764
pr_err(" unable to configure gpio %d", kim_gdata->nshutdown);
765-
return err;
765+
goto err_sysfs_group;
766766
}
767767
/* get reference of pdev for request_firmware
768768
*/

0 commit comments

Comments
 (0)