@@ -3556,6 +3556,9 @@ static int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
3556
3556
struct io_async_ctx * io = req -> io ;
3557
3557
int ret ;
3558
3558
3559
+ if (unlikely (req -> ctx -> flags & IORING_SETUP_IOPOLL ))
3560
+ return - EINVAL ;
3561
+
3559
3562
sr -> msg_flags = READ_ONCE (sqe -> msg_flags );
3560
3563
sr -> msg = u64_to_user_ptr (READ_ONCE (sqe -> addr ));
3561
3564
sr -> len = READ_ONCE (sqe -> len );
@@ -3585,9 +3588,6 @@ static int io_sendmsg(struct io_kiocb *req, bool force_nonblock)
3585
3588
struct socket * sock ;
3586
3589
int ret ;
3587
3590
3588
- if (unlikely (req -> ctx -> flags & IORING_SETUP_IOPOLL ))
3589
- return - EINVAL ;
3590
-
3591
3591
sock = sock_from_file (req -> file , & ret );
3592
3592
if (sock ) {
3593
3593
struct io_async_ctx io ;
@@ -3641,9 +3641,6 @@ static int io_send(struct io_kiocb *req, bool force_nonblock)
3641
3641
struct socket * sock ;
3642
3642
int ret ;
3643
3643
3644
- if (unlikely (req -> ctx -> flags & IORING_SETUP_IOPOLL ))
3645
- return - EINVAL ;
3646
-
3647
3644
sock = sock_from_file (req -> file , & ret );
3648
3645
if (sock ) {
3649
3646
struct io_sr_msg * sr = & req -> sr_msg ;
@@ -3796,6 +3793,9 @@ static int io_recvmsg_prep(struct io_kiocb *req,
3796
3793
struct io_async_ctx * io = req -> io ;
3797
3794
int ret ;
3798
3795
3796
+ if (unlikely (req -> ctx -> flags & IORING_SETUP_IOPOLL ))
3797
+ return - EINVAL ;
3798
+
3799
3799
sr -> msg_flags = READ_ONCE (sqe -> msg_flags );
3800
3800
sr -> msg = u64_to_user_ptr (READ_ONCE (sqe -> addr ));
3801
3801
sr -> len = READ_ONCE (sqe -> len );
@@ -3824,9 +3824,6 @@ static int io_recvmsg(struct io_kiocb *req, bool force_nonblock)
3824
3824
struct socket * sock ;
3825
3825
int ret , cflags = 0 ;
3826
3826
3827
- if (unlikely (req -> ctx -> flags & IORING_SETUP_IOPOLL ))
3828
- return - EINVAL ;
3829
-
3830
3827
sock = sock_from_file (req -> file , & ret );
3831
3828
if (sock ) {
3832
3829
struct io_buffer * kbuf ;
@@ -3888,9 +3885,6 @@ static int io_recv(struct io_kiocb *req, bool force_nonblock)
3888
3885
struct socket * sock ;
3889
3886
int ret , cflags = 0 ;
3890
3887
3891
- if (unlikely (req -> ctx -> flags & IORING_SETUP_IOPOLL ))
3892
- return - EINVAL ;
3893
-
3894
3888
sock = sock_from_file (req -> file , & ret );
3895
3889
if (sock ) {
3896
3890
struct io_sr_msg * sr = & req -> sr_msg ;
0 commit comments