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

Commit 991811c1 authored by Subash Abhinov Kasiviswanathan's avatar Subash Abhinov Kasiviswanathan
Browse files

net: rmnet_data: Handle leaked packets when adding MAP fields in TX



Some creators of skb's may fail to set sufficient headroom or
tailroom to stamp the MAP header or tailroom respectively when
transmitting packets to rmnet_data.

In these cases, rmnet_data was failing to free these packets which
lead to out of memory scenarios in low memory targets. Free these
skb's in these scenarios.

CRs-Fixed: 1086873
Change-Id: I8bd2eb93393766bf9c301766e525354770577e0a
Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
parent 53c1534d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -489,6 +489,7 @@ static int rmnet_map_egress_handler(struct sk_buff *skb,
		if (pskb_expand_head(skb, required_headroom, 0, GFP_KERNEL)) {
			LOGD("Failed to add headroom of %d bytes",
			     required_headroom);
			kfree_skb(skb);
			return 1;
		}
	}
@@ -512,6 +513,7 @@ static int rmnet_map_egress_handler(struct sk_buff *skb,

	if (!map_header) {
		LOGD("%s", "Failed to add MAP header to egress packet");
		kfree_skb(skb);
		return 1;
	}