arm64: rockchip: tsadc: Do not free the sysctl context is it wasn't created
MFC after: 3 weeks X-MFC-With: r355173
This commit is contained in:
parent
b388c5e994
commit
a0cb4996c6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=355190
@ -728,16 +728,17 @@ tsadc_attach(device_t dev)
|
||||
rv = tsadc_init_sysctl(sc);
|
||||
if (rv != 0) {
|
||||
device_printf(sc->dev, "Cannot initialize sysctls\n");
|
||||
goto fail;
|
||||
goto fail_sysctl;
|
||||
}
|
||||
|
||||
OF_device_register_xref(OF_xref_from_node(node), dev);
|
||||
return (bus_generic_attach(dev));
|
||||
|
||||
fail_sysctl:
|
||||
sysctl_ctx_free(&tsadc_sysctl_ctx);
|
||||
fail:
|
||||
if (sc->irq_ih != NULL)
|
||||
bus_teardown_intr(dev, sc->irq_res, sc->irq_ih);
|
||||
sysctl_ctx_free(&tsadc_sysctl_ctx);
|
||||
if (sc->tsadc_clk != NULL)
|
||||
clk_release(sc->tsadc_clk);
|
||||
if (sc->apb_pclk_clk != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user