i=maxim
fix memory leak in error handling of ptlrpc_init()
rc = ptlrpc_init_portals();
if (rc)
- RETURN(rc);
+ GOTO(cleanup, rc);
cleanup_phase = 2;
rc = ptlrpc_connection_init();
int n_cpus = num_online_cpus();
struct ptlrpc_hr_service *hr;
int size;
+ int rc;
ENTRY;
LASSERT(ptlrpc_hr == NULL);
hr->hr_size = size;
ptlrpc_hr = hr;
- RETURN(ptlrpc_start_hr_threads(hr));
+ rc = ptlrpc_start_hr_threads(hr);
+ if (rc) {
+ OBD_FREE(hr, hr->hr_size);
+ ptlrpc_hr = NULL;
+ }
+ RETURN(rc);
}
void ptlrpc_hr_fini(void)