Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f19893b authored by Kangjie Lu's avatar Kangjie Lu Committed by David S. Miller
Browse files

net: openvswitch: fix a NULL pointer dereference



upcall is dereferenced even when genlmsg_put fails. The fix
goto out to avoid the NULL pointer dereference in this case.

Signed-off-by: default avatarKangjie Lu <kjlu@umn.edu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4477138f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -448,6 +448,10 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,

	upcall = genlmsg_put(user_skb, 0, 0, &dp_packet_genl_family,
			     0, upcall_info->cmd);
	if (!upcall) {
		err = -EINVAL;
		goto out;
	}
	upcall->dp_ifindex = dp_ifindex;

	err = ovs_nla_put_key(key, key, OVS_PACKET_ATTR_KEY, false, user_skb);