From 6e960369d2105064ec09d0e08311adff209da3e4 Mon Sep 17 00:00:00 2001 From: Jiyoung Jeong Date: Wed, 24 Oct 2018 15:33:51 +0900 Subject: [PATCH] [9610] drivers: modem_if: If rxq is full, an error should be returned. Change-Id: Ib08cf216ac07e7bc13c71edbff6be2e72386925f Signed-off-by: Jiyoung Jeong --- drivers/misc/modem_if/modem_io_device.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/misc/modem_if/modem_io_device.c b/drivers/misc/modem_if/modem_io_device.c index b93738ae2edf..112f618e4231 100644 --- a/drivers/misc/modem_if/modem_io_device.c +++ b/drivers/misc/modem_if/modem_io_device.c @@ -171,16 +171,18 @@ static inline int queue_skb_to_iod(struct sk_buff *skb, struct io_device *iod) { struct sk_buff_head *rxq = &iod->sk_rx_q; - skb_queue_tail(rxq, skb); - - if (iod->format < IPC_MULTI_RAW && rxq->qlen > MAX_IOD_RXQ_LEN) { - mif_err("%s: %s application may be dead (rxq->qlen %d > %d)\n", + if ((iod->format < IPC_MULTI_RAW) && (rxq->qlen >= MAX_IOD_RXQ_LEN)) { + mif_err_limited("%s: %s application may be dead (rxq->qlen %d > %d)\n", iod->name, iod->app ? iod->app : "corresponding", rxq->qlen, MAX_IOD_RXQ_LEN); - skb_queue_purge(rxq); + + wake_up(&iod->wq); + return -ENOSPC; } + skb_queue_tail(rxq, skb); + mif_debug("%s: rxq->qlen = %d\n", iod->name, rxq->qlen); wake_up(&iod->wq); @@ -307,9 +309,7 @@ static int rx_raw_misc(struct sk_buff *skb) skb_pull(skb, EXYNOS_HEADER_SIZE); } - queue_skb_to_iod(skb, iod); - - return 0; + return queue_skb_to_iod(skb, iod); } #ifdef CONFIG_LINK_DEVICE_NAPI -- 2.20.1