net: octeontx: Free allocated memory on error
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 5 Aug 2025 15:45:49 +0000 (16:45 +0100)
committerJerome Forissier <jerome.forissier@linaro.org>
Mon, 18 Aug 2025 12:08:57 +0000 (14:08 +0200)
commit0ce7fef9e2154d188bd50ae687fb666faac8fe7b
tree7ab62c6158480411eecbcde1135236c2e9986e85
parent62b4a482b943bc8173ac10a6c783e84d939b88bf
net: octeontx: Free allocated memory on error

In octeontx_smi_probe if an error is detected then memory that was
allocated is not freed. Small refactor of the code to use a common
return and free memory. Also return -ENOMEM for an allocation failure.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/net/octeontx/smi.c