enjoy-digital / litepcie

Small footprint and configurable PCIe core
Other
451 stars 111 forks source link

software/kernel: always fail probe when entering error path #53

Closed a3f closed 2 years ago

a3f commented 2 years ago

ret wasn't initialized appropriately for some error paths leading to the probe to return 0 at the end of the error cleanup. This means at module unload time, the remove callback will be invoked leading to funny effects

Fix this by making sure ret != 0 for every goto into a failure path.

enjoy-digital commented 2 years ago

Thanks @a3f, this is merged.