rmnet_core: Check if port is valid before tx

Add check to ensure that rmnet_port value returned
by rmnet_get_port is not null before we go ahead
and try to queue up an skb to be transmitted via it.

Change-Id: I7890f4f2bcbb8dd300957c4fb12ec77f0412f4a6
Signed-off-by: Conner Huff <chuff@codeaurora.org>
This commit is contained in:
Conner Huff
2021-06-03 12:14:20 -07:00
parent 9c7db82138
commit dff15c9de8

View File

@@ -1641,6 +1641,10 @@ void rmnet_map_tx_qmap_cmd(struct sk_buff *qmap_skb, u8 ch, bool flush)
ch = RMNET_DEFAULT_AGG_STATE;
port = rmnet_get_port(qmap_skb->dev);
if (!port) {
kfree_skb(qmap_skb);
return;
}
state = &port->agg_state[ch];
if (!flush)