diff options
| author | Yi Yang <[email protected]> | 2022-12-02 09:21:26 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2022-12-08 16:45:58 +0100 |
| commit | 0cd142b4665ee3133cd80539b5a430be5fd326c6 (patch) | |
| tree | e7492d44bdfab7a12cf91b64faf86463900bec57 /tools/perf/util/scripting-engines/trace-event-python.c | |
| parent | 59d54aa09020fe52061d4cda51d474f5bd5e6be1 (diff) | |
usb: fotg210-udc: fix potential memory leak in fotg210_udc_probe()
In fotg210_udc_probe(), if devm_clk_get() or clk_prepare_enable()
fails, 'fotg210' will not be freed, which will lead to a memory leak.
Fix it by moving kfree() to a proper location.
In addition,we can use "return -ENOMEM" instead of "goto err"
to simplify the code.
Fixes: 718a38d092ec ("fotg210-udc: Handle PCLK")
Reviewed-by: Andrzej Pietrasiewicz <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Yi Yang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions