Unverified Commit 2d032cb8 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 64aa7242 865c6290
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -1799,15 +1799,14 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
		break;
	}
	case TIOCINQ: {
		/*
		 * These two are safe on a single CPU system as only
		 * user tasks fiddle here
		 */
		struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
		struct sk_buff *skb;
		long amount = 0;

		spin_lock_irq(&sk->sk_receive_queue.lock);
		skb = skb_peek(&sk->sk_receive_queue);
		if (skb)
			amount = skb->len - sizeof(struct ddpehdr);
		spin_unlock_irq(&sk->sk_receive_queue.lock);
		rc = put_user(amount, (int __user *)argp);
		break;
	}