Unmap 'base' if an error occurs after it has been mapped.
Reported-by: Tao Lan <taolan@huawei.com>
Closes: https://lore.kernel.org/lkml/ZNlSH+eWV8Sk3FYn@probook/
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
clk_data = kzalloc_obj(*clk_data);
if (!clk_data)
- goto err;
+ goto err_base;
clk_data->base = base;
clk_table = kzalloc_objs(*clk_table, nr_clks);
return clk_data;
err_data:
kfree(clk_data);
+err_base:
+ iounmap(base);
err:
return NULL;
}