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

Commit 0c4e4020 authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller
Browse files

qdisc: meta return ENOMEM on alloc failure



Rather than returning earlier value (EINVAL), return ENOMEM if
kzalloc fails. Found while reviewing to find another EINVAL condition.

Signed-off-by: default avatarStephen Hemminger <stephen@networkplumber.org>
Acked-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 90de527d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -793,8 +793,10 @@ static int em_meta_change(struct tcf_proto *tp, void *data, int len,
		goto errout;

	meta = kzalloc(sizeof(*meta), GFP_KERNEL);
	if (meta == NULL)
	if (meta == NULL) {
		err = -ENOMEM;
		goto errout;
	}

	memcpy(&meta->lvalue.hdr, &hdr->left, sizeof(hdr->left));
	memcpy(&meta->rvalue.hdr, &hdr->right, sizeof(hdr->right));