Commit 722e47d7 authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller

net_sched: fix error return code in fw_change_attrs()

The error code was not set if change indev fail, so the error
condition wasn't reflected in the return value. Fix to return a
negative error code from this error handling case instead of 0.

Fixes: 2519a602 ('net_sched: optimize tcf_match_indev()')
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8b88a11e
...@@ -209,8 +209,10 @@ fw_change_attrs(struct net *net, struct tcf_proto *tp, struct fw_filter *f, ...@@ -209,8 +209,10 @@ fw_change_attrs(struct net *net, struct tcf_proto *tp, struct fw_filter *f,
if (tb[TCA_FW_INDEV]) { if (tb[TCA_FW_INDEV]) {
int ret; int ret;
ret = tcf_change_indev(net, tb[TCA_FW_INDEV]); ret = tcf_change_indev(net, tb[TCA_FW_INDEV]);
if (ret < 0) if (ret < 0) {
err = ret;
goto errout; goto errout;
}
f->ifindex = ret; f->ifindex = ret;
} }
#endif /* CONFIG_NET_CLS_IND */ #endif /* CONFIG_NET_CLS_IND */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment