Commit dd3cc52
netdev-dpdk: Fix memory leak when configuring rx-steering.
VLOG_WARN_BUF() allocates a new string with xasprintf() every time it is
called and overwrites *errp without freeing the previous value. This can
lead to a memory leak if multiple warnings are emitted or if a later
hard error in netdev_dpdk_set_config() also writes to errp.
The three cases in dpdk_set_rx_steer_config() are not fatal errors:
- unsupported rx-steering value
- rss+lacp on non-ethernet port
- rss+lacp together with hw-offload
In all cases program simply log a warning and fall back to default RSS
steering. Configuration continues normally (err remains 0 and execution
flow do not goto out).
Therefore change them to plain VLOG_WARN(). As a result the 'errp'
parameter becomes unused and is removed from the function signature and
the call site in netdev_dpdk_set_config().
This makes the code cleaner and consistent with the rest of netdev-dpdk.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: fc06ea9 ("netdev-dpdk: Add custom rx-steering configuration.")
Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>1 parent 097f472 commit dd3cc52
1 file changed
Lines changed: 9 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2270 | 2270 | | |
2271 | 2271 | | |
2272 | 2272 | | |
2273 | | - | |
| 2273 | + | |
2274 | 2274 | | |
2275 | 2275 | | |
2276 | 2276 | | |
2277 | 2277 | | |
2278 | 2278 | | |
2279 | 2279 | | |
2280 | 2280 | | |
2281 | | - | |
2282 | | - | |
2283 | | - | |
| 2281 | + | |
| 2282 | + | |
2284 | 2283 | | |
2285 | 2284 | | |
2286 | 2285 | | |
2287 | | - | |
2288 | | - | |
2289 | | - | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
2290 | 2289 | | |
2291 | 2290 | | |
2292 | 2291 | | |
2293 | 2292 | | |
2294 | | - | |
2295 | | - | |
2296 | | - | |
| 2293 | + | |
| 2294 | + | |
2297 | 2295 | | |
2298 | 2296 | | |
2299 | 2297 | | |
| |||
2323 | 2321 | | |
2324 | 2322 | | |
2325 | 2323 | | |
2326 | | - | |
| 2324 | + | |
2327 | 2325 | | |
2328 | 2326 | | |
2329 | 2327 | | |
| |||
0 commit comments