Unverified Commit 2380c87d authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 6cb3706d 74e69053
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1307,9 +1307,11 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
	case TIOCINQ: {
		struct sk_buff *skb;
		long amount = 0L;
		/* These two are safe on a single CPU system as only user tasks fiddle here */

		spin_lock_irq(&sk->sk_receive_queue.lock);
		if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL)
			amount = skb->len;
		spin_unlock_irq(&sk->sk_receive_queue.lock);
		return put_user(amount, (unsigned int __user *) argp);
	}