Skip to content

Commit

Permalink
net_sched: fix error return code in fw_change_attrs()
Browse files Browse the repository at this point in the history
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: 2519a60 ('net_sched: optimize tcf_match_indev()')
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Jan 17, 2014
1 parent 8b88a11 commit 722e47d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/sched/cls_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ fw_change_attrs(struct net *net, struct tcf_proto *tp, struct fw_filter *f,
if (tb[TCA_FW_INDEV]) {
int ret;
ret = tcf_change_indev(net, tb[TCA_FW_INDEV]);
if (ret < 0)
if (ret < 0) {
err = ret;
goto errout;
}
f->ifindex = ret;
}
#endif /* CONFIG_NET_CLS_IND */
Expand Down

0 comments on commit 722e47d

Please sign in to comment.