Commit ee1d4531 authored by Federico Vaga's avatar Federico Vaga

sw:drv: fix spec_fpga_exit() validation

If the FPGA bitstream has not been discovered correctly, then
it does not exist a spec_fpga device. This implies that also
the access to the FPGA is forbidden; therefore, the only mechanism to
check if we failed to load the FPGA content is to check if
the spec_fpga pointer is valid.
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 3bb69c00
......@@ -825,6 +825,7 @@ err_valid:
iounmap(spec_fpga->fpga);
err_map:
kfree(spec_fpga);
spec_gn412x->spec_fpga = NULL;
return err;
}
......@@ -832,7 +833,7 @@ int spec_fpga_exit(struct spec_gn412x *spec_gn412x)
{
struct spec_fpga *spec_fpga = spec_gn412x->spec_fpga;
if (!spec_fpga_is_valid(spec_gn412x, spec_fpga->meta))
if (!spec_fpga)
return 0;
spec_fpga_dbg_exit(spec_fpga);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment