Skip to contentSkip to conversation

qdisc: meta return ENOMEM on alloc failure

PATCH Applied Stephen Hemminger 3 participants 3 messages Sep 27, 2013 – Sep 30, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

net/sched/em_meta.c +3 -1
@@ -793,8 +793,10 @@ static int em_meta_change(struct tcf_pro
 		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));