[9610] drivers: modem_if: If rxq is full, an error should be returned.
authorJiyoung Jeong <ji_0.jeong@samsung.com>
Wed, 24 Oct 2018 06:33:51 +0000 (15:33 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:06 +0000 (20:23 +0300)
Change-Id: Ib08cf216ac07e7bc13c71edbff6be2e72386925f
Signed-off-by: Jiyoung Jeong <ji_0.jeong@samsung.com>
drivers/misc/modem_if/modem_io_device.c

index b93738ae2edfd2b29ffc53ef821f5365423f51bf..112f618e4231d2fbbea46c5e0f617fb47154f667 100644 (file)
@@ -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