diff options
Diffstat (limited to 'net/core/skmsg.c')
| -rw-r--r-- | net/core/skmsg.c | 15 | 
1 files changed, 9 insertions, 6 deletions
diff --git a/net/core/skmsg.c b/net/core/skmsg.c index ad31e4e53d0a..ded2d5227678 100644 --- a/net/core/skmsg.c +++ b/net/core/skmsg.c @@ -421,7 +421,7 @@ static int sk_psock_skb_ingress(struct sk_psock *psock, struct sk_buff *skb)  	copied = skb->len;  	msg->sg.start = 0;  	msg->sg.size = copied; -	msg->sg.end = num_sge == MAX_MSG_FRAGS ? 0 : num_sge; +	msg->sg.end = num_sge;  	msg->skb = skb;  	sk_psock_queue_msg(psock, msg); @@ -793,15 +793,18 @@ static void sk_psock_strp_data_ready(struct sock *sk)  static void sk_psock_write_space(struct sock *sk)  {  	struct sk_psock *psock; -	void (*write_space)(struct sock *sk); +	void (*write_space)(struct sock *sk) = NULL;  	rcu_read_lock();  	psock = sk_psock(sk); -	if (likely(psock && sk_psock_test_state(psock, SK_PSOCK_TX_ENABLED))) -		schedule_work(&psock->work); -	write_space = psock->saved_write_space; +	if (likely(psock)) { +		if (sk_psock_test_state(psock, SK_PSOCK_TX_ENABLED)) +			schedule_work(&psock->work); +		write_space = psock->saved_write_space; +	}  	rcu_read_unlock(); -	write_space(sk); +	if (write_space) +		write_space(sk);  }  int sk_psock_init_strp(struct sock *sk, struct sk_psock *psock)  |