Skip to content

Commit

Permalink
net/enic: avoid extra unlock in MTU set
Browse files Browse the repository at this point in the history
[ upstream commit e90884a65bf6d8ed0e1e5618af42cf5856a422f1 ]

The 'set_mtu_done' goto statement is being executed in a context
where the 'mtu_lock' has not been previously locked.

To avoid the extra unlocking operation, replace the goto statement
with a return statement.

Fixes: c3e0918 ("net/enic: support scatter Rx in MTU update")

Signed-off-by: Weiguo Li <liweiguo@xencore.cn>
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
  • Loading branch information
liwg06 authored and bluca committed Nov 8, 2023
1 parent 6cdc038 commit 02f1c31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/enic/enic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1630,7 +1630,7 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu)
* packet length.
*/
if (!eth_dev->data->dev_started)
goto set_mtu_done;
return rc;

/*
* The device has started, re-do RQs on the fly. In the process, we
Expand Down

0 comments on commit 02f1c31

Please sign in to comment.