Skip to content

Commit

Permalink
ovs: fix dp check in ovs_dp_reset_user_features
Browse files Browse the repository at this point in the history
This fixes crash when userspace does "ovs-dpctl add-dp dev" where dev is
existing non-dp netdevice.

Introduced by:
commit 44da5ae
"openvswitch: Drop user features if old user space attempted to create datapath"

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Jesse Gross <jesse@nicira.com>
  • Loading branch information
Jiri Pirko authored and Jesse Gross committed Feb 16, 2014
1 parent c14e095 commit 3c7eacf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/openvswitch/datapath.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ static void ovs_dp_reset_user_features(struct sk_buff *skb, struct genl_info *in
struct datapath *dp;

dp = lookup_datapath(sock_net(skb->sk), info->userhdr, info->attrs);
if (!dp)
if (IS_ERR(dp))
return;

WARN(dp->user_features, "Dropping previously announced user features\n");
Expand Down

0 comments on commit 3c7eacf

Please sign in to comment.