Add missing code to free adapter when the device initialization fails.
Fixes:
8318984927ff ("cxgbe: add pmd skeleton")
Reported-by: Seth Arnold <seth.arnold@canonical.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
pi->adapter = adapter;
err = cxgbe_probe(adapter);
- if (err)
+ if (err) {
dev_err(adapter, "%s: cxgbe probe failed with err %d\n",
__func__, err);
+ goto out_free_adapter;
+ }
+
+ return 0;
out_free_adapter:
+ rte_free(adapter);
return err;
}