net/ice/base: fix resource leak
authorQi Zhang <qi.z.zhang@intel.com>
Tue, 23 Jul 2019 03:51:11 +0000 (11:51 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 24 Jul 2019 14:00:57 +0000 (16:00 +0200)
commit04221f0b3e9e49b410337caf9372be3fa7189aab
tree21fad7bb9fa1ed420eb14306a303774785bdec47
parentb83a0c2903223f3b26838e75ab6ff0afeb653dc3
net/ice/base: fix resource leak

We don't free s_rule if ice_aq_sw_rules() returns a non-zero status. If
it returned a zero status, s_rule would be freed right after, so this
implies it should be freed within the scope of the function regardless.

Fixes: c7dd15931183 ("net/ice/base: add virtual switch code")
Cc: stable@dpdk.org
Signed-off-by: Jeb Cramer <jeb.j.cramer@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
drivers/net/ice/base/ice_switch.c