cxgbe(4): Do not leak memory in case of errors during VI initialization.

Reported by:	Coverity (CID 1392026)
MFC after:	1 week
Sponsored by:	Chelsio Communications
This commit is contained in:
Navdeep Parhar 2018-08-21 22:15:57 +00:00
parent eb6f5d6e72
commit e758d7758a

View File

@ -5099,6 +5099,7 @@ vi_full_init(struct vi_info *vi)
rc = -t4_config_rss_range(sc, sc->mbox, vi->viid, 0, vi->rss_size, rss,
vi->rss_size);
if (rc != 0) {
free(rss, M_CXGBE);
if_printf(ifp, "rss_config failed: %d\n", rc);
goto done;
}
@ -5147,6 +5148,7 @@ vi_full_init(struct vi_info *vi)
#endif
rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, hashen, rss[0], 0, 0);
if (rc != 0) {
free(rss, M_CXGBE);
if_printf(ifp, "rss hash/defaultq config failed: %d\n", rc);
goto done;
}