mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
ptp: Fix resource leak in case of error
A call to 'ida_simple_remove()' is missing in the error handling path.
This as been spotted with the following coccinelle script which tries to
detect missing 'ida_simple_remove()' call in error handling paths.
///////////////
@@
expression x;
identifier l;
@@
* x = ida_simple_get(...);
...
if (...) {
...
}
...
if (...) {
...
goto l;
}
...
* l: ... when != ida_simple_remove(...);
Signed-off-by: Christophe JAILLET <[email protected]>
Acked-by: Richard Cochran <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
0fd7d43fbc
commit
b9118b7221
1 changed files with 1 additions and 0 deletions
|
|
@ -263,6 +263,7 @@ no_sysfs:
|
|||
no_device:
|
||||
mutex_destroy(&ptp->tsevq_mux);
|
||||
mutex_destroy(&ptp->pincfg_mux);
|
||||
ida_simple_remove(&ptp_clocks_map, index);
|
||||
no_slot:
|
||||
kfree(ptp);
|
||||
no_memory:
|
||||
|
|
|
|||
Loading…
Reference in a new issue