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 <christophe.jaillet@wanadoo.fr>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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: