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

Commit 31d3c855 authored by Nadine Toledano's avatar Nadine Toledano
Browse files

msm: ipa: do not send zero length packet to IPA



Fail the operation of ipa_tx_dp() in case skb size is zero.
This is done as IPA will not generate a status packet for zero
length packet and to avoid a possible memory leak.

Change-Id: I8abab2e32e5937a86802d2d5c73c4e7243775ea5
Acked-by: default avatarAdy Abraham <adya@qti.qualcomm.com>
Signed-off-by: default avatarNadine Toledano <nadinet@codeaurora.org>
parent dc75cd31
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015, 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
@@ -1269,6 +1269,11 @@ int ipa_tx_dp(enum ipa_client_type dst, struct sk_buff *skb,

	memset(desc, 0, 2 * sizeof(struct ipa_desc));

	if (skb->len == 0) {
		IPAERR("packet size is 0\n");
		return -EINVAL;
	}

	/*
	 * USB_CONS: PKT_INIT ep_idx = dst pipe
	 * Q6_CONS: PKT_INIT ep_idx = sender pipe