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

Commit c4ea6f1e authored by Abhishek Choubey's avatar Abhishek Choubey
Browse files

msm: ipa: Add NULL check for skb



Add a NULL pointer check to make sure skb is valid.

Change-Id: I918482c7206f1f43b029ef7d20efe250947bdc32
Signed-off-by: default avatarAbhishek Choubey <abchoube@codeaurora.org>
parent 9d7ab43a
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2018-2019, 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
@@ -675,9 +675,14 @@ static void ipa_gsb_cons_cb(void *priv, enum ipa_dp_evt_type evt,
		return;
	}

	if (!data) {
		IPA_GSB_ERR("Invalid data\n");
		return;
	}

	skb = (struct sk_buff *)data;

	while (skb && skb->len) {
	while (skb->len) {
		mux_hdr = (struct ipa_gsb_mux_hdr *)skb->data;
		pkt_size = mux_hdr->pkt_size;
		/* 4-byte padding */