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 kevintraynor committed Nov 16, 2023
1 parent 6d69e09 commit 48ce632
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,7 @@ Waterman Cao <waterman.cao@intel.com>
Weichun Chen <weichunx.chen@intel.com>
Wei Dai <wei.dai@intel.com>
Weifeng Li <liweifeng96@126.com>
Weiguo Li <liwg06@foxmail.com>
Weiguo Li <liweiguo@xencore.cn> <liwg06@foxmail.com>
Wei Huang <wei.huang@intel.com>
Wei Hu (Xavier) <xavier.huwei@huawei.com>
WeiJie Zhuang <zhuangwj@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/enic/enic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1639,7 +1639,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 48ce632

Please sign in to comment.