From 2f8c6cfb506aad3b9b498917878e65149c3b67b2 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 16 Jun 2009 14:16:14 -0700 Subject: [PATCH] datapath: Remove unnecessary range check from put_actions(). This code checked that the number of actions in a flow query did not exceed the maximum number of actions that are allowed on a given flow. But this check is unnecessary, since the code will never copy out any more actions than actually exist in a flow. It would be a shame to refuse a flow query simply on the basis that the caller allocated more memory than necessary, so eliminate the check. --- datapath/datapath.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index 14d83cd92..ceaed1537 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -959,8 +959,6 @@ static int put_actions(const struct sw_flow *flow, struct odp_flow __user *ufp) if (!n_actions) return 0; - if (ufp->n_actions > INT_MAX / sizeof(union odp_action)) - return -EINVAL; sf_acts = rcu_dereference(flow->sf_acts); if (__put_user(sf_acts->n_actions, &ufp->n_actions) || -- 2.43.0