Use devm API to prevent memory leaks

Fixes also the errors paths in probe