mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
s390/perf: Return error when debug_register fails
[ Upstream commit ec0c0bb489 ]
Return an error when the function debug_register() fails allocating
the debug handle.
Also remove the registered debug handle when the initialization fails
later on.
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2d10957150
commit
014787bb26
@@ -1611,14 +1611,17 @@ static int __init init_cpum_sampling_pmu(void)
|
||||
}
|
||||
|
||||
sfdbg = debug_register(KMSG_COMPONENT, 2, 1, 80);
|
||||
if (!sfdbg)
|
||||
if (!sfdbg) {
|
||||
pr_err("Registering for s390dbf failed\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
debug_register_view(sfdbg, &debug_sprintf_view);
|
||||
|
||||
err = register_external_irq(EXT_IRQ_MEASURE_ALERT,
|
||||
cpumf_measurement_alert);
|
||||
if (err) {
|
||||
pr_cpumsf_err(RS_INIT_FAILURE_ALRT);
|
||||
debug_unregister(sfdbg);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1627,6 +1630,7 @@ static int __init init_cpum_sampling_pmu(void)
|
||||
pr_cpumsf_err(RS_INIT_FAILURE_PERF);
|
||||
unregister_external_irq(EXT_IRQ_MEASURE_ALERT,
|
||||
cpumf_measurement_alert);
|
||||
debug_unregister(sfdbg);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user