:::::: :::::: Manual check reason: "low confidence bisect report" :::::: Manual check reason: "low confidence static check warning: net/rxrpc/sendmsg.c:409:26: warning: use of uninitialized value 'txb' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]" :::::: BCC: lkp@intel.com CC: oe-kbuild-all@lists.linux.dev CC: Linux Memory Management List TO: David Howells tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 147307c69ba4441ee90c1f8ce8edf5df4ea60f67 commit: a4ea4c47761943d90cd5d1688b3c3c65922ff2b1 [5427/8929] rxrpc: Don't use a ring buffer for call Tx queue :::::: branch date: 29 hours ago :::::: commit date: 11 days ago config: arm-randconfig-c002-20221117 compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=a4ea4c47761943d90cd5d1688b3c3c65922ff2b1 git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout a4ea4c47761943d90cd5d1688b3c3c65922ff2b1 # save the config file COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross ARCH=arm KBUILD_USERCFLAGS='-fanalyzer -Wno-error' If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot gcc_analyzer warnings: (new ones prefixed by >>) | 'rxrpc_send_data': event 19 | |include/linux/compiler.h:58:30: | 58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) | | ^ | | | | | (19) following 'true' branch... include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var' | 56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) | | ^~~~~~~~~~~~~~ net/rxrpc/sendmsg.c:303:9: note: in expansion of macro 'if' | 303 | if (state != RXRPC_CALL_CLIENT_SEND_REQUEST && | | ^~ | 'rxrpc_send_data': event 20 | |include/linux/compiler.h:56:44: | 56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) | | ^ | | | | | (20) ...to here include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var' | 58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) | | ^~~~ net/rxrpc/sendmsg.c:303:9: note: in expansion of macro 'if' | 303 | if (state != RXRPC_CALL_CLIENT_SEND_REQUEST && | | ^~ | 'rxrpc_send_data': event 21 | |include/linux/compiler.h:58:30: | 58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) | | ^ | | | | | (21) following 'true' branch... include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var' | 56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) | | ^~~~~~~~~~~~~~ net/rxrpc/sendmsg.c:309:9: note: in expansion of macro 'if' | 309 | if (call->tx_total_len != -1) { | | ^~ | 'rxrpc_send_data': event 22 | |include/linux/compiler.h:56:26: | 56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) | | ^ | | | | | (22) ...to here net/rxrpc/sendmsg.c:309:9: note: in expansion of macro 'if' | 309 | if (call->tx_total_len != -1) { | | ^~ | 'rxrpc_send_data': event 23 | |include/linux/compiler.h:58:30: | 58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) | | ^ | | | | | (23) following 'true' branch... include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var' | 56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) | | ^~~~~~~~~~~~~~ net/rxrpc/sendmsg.c:318:9: note: in expansion of macro 'if' | 318 | if (txb) | | ^~ | 'rxrpc_send_data': event 24 | |include/linux/compiler.h:56:26: | 56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) | | ^ | | | | | (24) ...to here net/rxrpc/sendmsg.c:318:9: note: in expansion of macro 'if' | 318 | if (txb) | | ^~ | 'rxrpc_send_data': event 25 | |include/linux/compiler.h:58:30: | 58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) | | ^ | | | | | (25) following 'true' branch... include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var' | 56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) | | ^~~~~~~~~~~~~~ net/rxrpc/sendmsg.c:324:17: note: in expansion of macro 'if' | 324 | if (!txb) { | | ^~ | 'rxrpc_send_data': events 26-27 | | 325 | size_t remain, bufsize, chunk, offset; | | ^~~~~~ ~~~~~~ | | | | | | (26) ...to here (27) use of uninitialized value '' here | >> net/rxrpc/sendmsg.c:409:26: warning: use of uninitialized value 'txb' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 409 | call->tx_pending = txb; | ~~~~~~~~~~~~~~~~~^~~~~ 'rxrpc_kernel_send_data': event 1 | | 747 | int rxrpc_kernel_send_data(struct socket *sock, struct rxrpc_call *call, | | ^~~~~~~~~~~~~~~~~~~~~~ | | | | | (1) entry to 'rxrpc_kernel_send_data' | 'rxrpc_kernel_send_data': event 2 | |include/linux/compiler.h:70:46: | 69 | (cond) ? \ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 70 | (__if_trace.miss_hit[1]++,1) : \ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ | | | | | (2) following 'false' branch (when '______r == 0')... | 71 | (__if_trace.miss_hit[0]++,0); \ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:58:69: note: in expansion of macro '__trace_if_value' | 58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) | | ^~~~~~~~~~~~~~~~ include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var' | 56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) | | ^~~~~~~~~~~~~~ net/rxrpc/ar-internal.h:1284:9: note: in expansion of macro 'if' | 1284 | if (unlikely(!(_x OP _y))) { \ | | ^~ net/rxrpc/sendmsg.c:756:9: note: in expansion of macro 'ASSERTCMP' | 756 | ASSERTCMP(msg->msg_name, ==, NULL); | | ^~~~~~~~~ | 'rxrpc_kernel_send_data': event 3 | |include/linux/compiler.h:71:37: | 71 | (__if_trace.miss_hit[0]++,0); \ | | ~~~~~~~~~~~~~~~~~~~^~~ | | | | | (3) ...to here include/linux/compiler.h:58:69: note: in expansion of macro '__trace_if_value' | 58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) | | ^~~~~~~~~~~~~~~~ include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var' | 56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) | | ^~~~~~~~~~~~~~ net/rxrpc/ar-internal.h:1284:9: note: in expansion of macro 'if' | 1284 | if (unlikely(!(_x OP _y))) { \ | | ^~ net/rxrpc/sendmsg.c:756:9: note: in expansion of macro 'ASSERTCMP' | 756 | ASSERTCMP(msg->msg_name, ==, NULL); | | ^~~~~~~~~ | 'rxrpc_kernel_send_data': event 4 | |include/linux/compiler.h:70:46: | 69 | (cond) ? \ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 70 | (__if_trace.miss_hit[1]++,1) : \ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ | | | | | (4) following 'false' branch (when '______r == 0')... | 71 | (__if_trace.miss_hit[0]++,0); \ | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:58:69: note: in expansion of macro '__trace_if_value' | 58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) | | ^~~~~~~~~~~~~~~~ include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var' | 56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) | | ^~~~~~~~~~~~~~ net/rxrpc/ar-internal.h:1284:9: note: in expansion of macro 'if' | 1284 | if (unlikely(!(_x OP _y))) { \ | | ^~ net/rxrpc/sendmsg.c:757:9: note: in expansion of macro 'ASSERTCMP' | 757 | ASSERTCMP(msg->msg_control, ==, NULL); | | ^~~~~~~~~ | 'rxrpc_kernel_send_data': event 5 | |include/linux/compiler.h:71:37: | 71 | (__if_trace.miss_hit[0]++,0); \ | | ~~~~~~~~~~~~~~~~~~~^~~ | | | | | (5) ...to here include/linux/compiler.h:58:69: note: in expansion of macro '__trace_if_value' | 58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) | | ^~~~~~~~~~~~~~~~ include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var' | 56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) | | ^~~~~~~~~~~~~~ net/rxrpc/ar-internal.h:1284:9: note: in expansion of macro 'if' | 1284 | if (unlikely(!(_x OP _y))) { \ | | ^~ net/rxrpc/sendmsg.c:757:9: note: in expansion of macro 'ASSERTCMP' | 757 | ASSERTCMP(msg->msg_control, ==, NULL); | | ^~~~~~~~~ | 'rxrpc_kernel_send_data': events 6-8 | | 764 | switch (READ_ONCE(call->state)) { vim +/txb +409 net/rxrpc/sendmsg.c 0b58b8a18be493 David Howells 2016-09-02 270 0b58b8a18be493 David Howells 2016-09-02 271 /* 0b58b8a18be493 David Howells 2016-09-02 272 * send data through a socket 0b58b8a18be493 David Howells 2016-09-02 273 * - must be called in process context 540b1c48c37ac0 David Howells 2017-02-27 274 * - The caller holds the call user access mutex, but not the socket lock. 0b58b8a18be493 David Howells 2016-09-02 275 */ 0b58b8a18be493 David Howells 2016-09-02 276 static int rxrpc_send_data(struct rxrpc_sock *rx, 0b58b8a18be493 David Howells 2016-09-02 277 struct rxrpc_call *call, e833251ad81316 David Howells 2017-08-29 278 struct msghdr *msg, size_t len, b0f571ecd79434 David Howells 2022-08-24 279 rxrpc_notify_end_tx_t notify_end_tx, b0f571ecd79434 David Howells 2022-08-24 280 bool *_dropped_lock) 0b58b8a18be493 David Howells 2016-09-02 281 { a4ea4c47761943 David Howells 2022-03-31 282 struct rxrpc_txbuf *txb; 0b58b8a18be493 David Howells 2016-09-02 283 struct sock *sk = &rx->sk; b0f571ecd79434 David Howells 2022-08-24 284 enum rxrpc_call_state state; 0b58b8a18be493 David Howells 2016-09-02 285 long timeo; b0f571ecd79434 David Howells 2022-08-24 286 bool more = msg->msg_flags & MSG_MORE; b0f571ecd79434 David Howells 2022-08-24 287 int ret, copied = 0; 0b58b8a18be493 David Howells 2016-09-02 288 0b58b8a18be493 David Howells 2016-09-02 289 timeo = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT); 0b58b8a18be493 David Howells 2016-09-02 290 0b58b8a18be493 David Howells 2016-09-02 291 /* this should be in poll */ 0b58b8a18be493 David Howells 2016-09-02 292 sk_clear_bit(SOCKWQ_ASYNC_NOSPACE, sk); 0b58b8a18be493 David Howells 2016-09-02 293 b0f571ecd79434 David Howells 2022-08-24 294 reload: b0f571ecd79434 David Howells 2022-08-24 295 ret = -EPIPE; 639f181f0ee20d David Howells 2020-07-20 296 if (sk->sk_shutdown & SEND_SHUTDOWN) b0f571ecd79434 David Howells 2022-08-24 297 goto maybe_error; b0f571ecd79434 David Howells 2022-08-24 298 state = READ_ONCE(call->state); b0f571ecd79434 David Howells 2022-08-24 299 ret = -ESHUTDOWN; b0f571ecd79434 David Howells 2022-08-24 300 if (state >= RXRPC_CALL_COMPLETE) b0f571ecd79434 David Howells 2022-08-24 301 goto maybe_error; b0f571ecd79434 David Howells 2022-08-24 302 ret = -EPROTO; b0f571ecd79434 David Howells 2022-08-24 303 if (state != RXRPC_CALL_CLIENT_SEND_REQUEST && b0f571ecd79434 David Howells 2022-08-24 304 state != RXRPC_CALL_SERVER_ACK_REQUEST && b0f571ecd79434 David Howells 2022-08-24 305 state != RXRPC_CALL_SERVER_SEND_REPLY) b0f571ecd79434 David Howells 2022-08-24 306 goto maybe_error; 0b58b8a18be493 David Howells 2016-09-02 307 b0f571ecd79434 David Howells 2022-08-24 308 ret = -EMSGSIZE; e754eba685aac2 David Howells 2017-06-07 309 if (call->tx_total_len != -1) { b0f571ecd79434 David Howells 2022-08-24 310 if (len - copied > call->tx_total_len) b0f571ecd79434 David Howells 2022-08-24 311 goto maybe_error; b0f571ecd79434 David Howells 2022-08-24 312 if (!more && len - copied != call->tx_total_len) b0f571ecd79434 David Howells 2022-08-24 313 goto maybe_error; e754eba685aac2 David Howells 2017-06-07 314 } e754eba685aac2 David Howells 2017-06-07 315 a4ea4c47761943 David Howells 2022-03-31 316 txb = call->tx_pending; 0b58b8a18be493 David Howells 2016-09-02 317 call->tx_pending = NULL; a4ea4c47761943 David Howells 2022-03-31 318 if (txb) a4ea4c47761943 David Howells 2022-03-31 319 rxrpc_see_txbuf(txb, rxrpc_txbuf_see_send_more); 0b58b8a18be493 David Howells 2016-09-02 320 0b58b8a18be493 David Howells 2016-09-02 321 do { 72f0c6fb057971 David Howells 2020-01-30 322 rxrpc_transmit_ack_packets(call->peer->local); 7aa51da7c88d42 David Howells 2016-09-22 323 a4ea4c47761943 David Howells 2022-03-31 324 if (!txb) { d7d775b1ffb154 David Howells 2020-09-16 325 size_t remain, bufsize, chunk, offset; 0b58b8a18be493 David Howells 2016-09-02 326 0b58b8a18be493 David Howells 2016-09-02 327 _debug("alloc"); 0b58b8a18be493 David Howells 2016-09-02 328 b0f571ecd79434 David Howells 2022-08-24 329 if (!rxrpc_check_tx_space(call, NULL)) b0f571ecd79434 David Howells 2022-08-24 330 goto wait_for_space; 0b58b8a18be493 David Howells 2016-09-02 331 d7d775b1ffb154 David Howells 2020-09-16 332 /* Work out the maximum size of a packet. Assume that d7d775b1ffb154 David Howells 2020-09-16 333 * the security header is going to be in the padded d7d775b1ffb154 David Howells 2020-09-16 334 * region (enc blocksize), but the trailer is not. d7d775b1ffb154 David Howells 2020-09-16 335 */ d7d775b1ffb154 David Howells 2020-09-16 336 remain = more ? INT_MAX : msg_data_left(msg); d7d775b1ffb154 David Howells 2020-09-16 337 ret = call->conn->security->how_much_data(call, remain, d7d775b1ffb154 David Howells 2020-09-16 338 &bufsize, &chunk, &offset); d7d775b1ffb154 David Howells 2020-09-16 339 if (ret < 0) d7d775b1ffb154 David Howells 2020-09-16 340 goto maybe_error; 0b58b8a18be493 David Howells 2016-09-02 341 d7d775b1ffb154 David Howells 2020-09-16 342 _debug("SIZE: %zu/%zu @%zu", chunk, bufsize, offset); 0b58b8a18be493 David Howells 2016-09-02 343 0b58b8a18be493 David Howells 2016-09-02 344 /* create a buffer that we can retain until it's ACK'd */ a4ea4c47761943 David Howells 2022-03-31 345 ret = -ENOMEM; a4ea4c47761943 David Howells 2022-03-31 346 txb = rxrpc_alloc_txbuf(call, RXRPC_PACKET_TYPE_DATA, a4ea4c47761943 David Howells 2022-03-31 347 GFP_KERNEL); a4ea4c47761943 David Howells 2022-03-31 348 if (!txb) 0b58b8a18be493 David Howells 2016-09-02 349 goto maybe_error; 0b58b8a18be493 David Howells 2016-09-02 350 a4ea4c47761943 David Howells 2022-03-31 351 txb->offset = offset; a4ea4c47761943 David Howells 2022-03-31 352 txb->space -= offset; a4ea4c47761943 David Howells 2022-03-31 353 txb->space = min_t(size_t, chunk, txb->space); 0b58b8a18be493 David Howells 2016-09-02 354 } 0b58b8a18be493 David Howells 2016-09-02 355 0b58b8a18be493 David Howells 2016-09-02 356 _debug("append"); 0b58b8a18be493 David Howells 2016-09-02 357 0b58b8a18be493 David Howells 2016-09-02 358 /* append next segment of data to the current buffer */ 0b58b8a18be493 David Howells 2016-09-02 359 if (msg_data_left(msg) > 0) { a4ea4c47761943 David Howells 2022-03-31 360 size_t copy = min_t(size_t, txb->space, msg_data_left(msg)); a4ea4c47761943 David Howells 2022-03-31 361 a4ea4c47761943 David Howells 2022-03-31 362 _debug("add %zu", copy); a4ea4c47761943 David Howells 2022-03-31 363 if (!copy_from_iter_full(txb->data + txb->offset, copy, a4ea4c47761943 David Howells 2022-03-31 364 &msg->msg_iter)) 0b58b8a18be493 David Howells 2016-09-02 365 goto efault; a4ea4c47761943 David Howells 2022-03-31 366 _debug("added"); a4ea4c47761943 David Howells 2022-03-31 367 txb->space -= copy; a4ea4c47761943 David Howells 2022-03-31 368 txb->len += copy; a4ea4c47761943 David Howells 2022-03-31 369 txb->offset += copy; 0b58b8a18be493 David Howells 2016-09-02 370 copied += copy; e754eba685aac2 David Howells 2017-06-07 371 if (call->tx_total_len != -1) e754eba685aac2 David Howells 2017-06-07 372 call->tx_total_len -= copy; 0b58b8a18be493 David Howells 2016-09-02 373 } 0b58b8a18be493 David Howells 2016-09-02 374 e122d845a01ece David Howells 2019-01-10 375 /* check for the far side aborting the call or a network error e122d845a01ece David Howells 2019-01-10 376 * occurring */ e122d845a01ece David Howells 2019-01-10 377 if (call->state == RXRPC_CALL_COMPLETE) e122d845a01ece David Howells 2019-01-10 378 goto call_terminated; e122d845a01ece David Howells 2019-01-10 379 0b58b8a18be493 David Howells 2016-09-02 380 /* add the packet to the send queue if it's now full */ a4ea4c47761943 David Howells 2022-03-31 381 if (!txb->space || 0b58b8a18be493 David Howells 2016-09-02 382 (msg_data_left(msg) == 0 && !more)) { a4ea4c47761943 David Howells 2022-03-31 383 if (msg_data_left(msg) == 0 && !more) { a4ea4c47761943 David Howells 2022-03-31 384 txb->wire.flags |= RXRPC_LAST_PACKET; a4ea4c47761943 David Howells 2022-03-31 385 __set_bit(RXRPC_TXBUF_LAST, &txb->flags); a4ea4c47761943 David Howells 2022-03-31 386 } a4ea4c47761943 David Howells 2022-03-31 387 else if (call->tx_top - call->acks_hard_ack < 248f219cb8bcbf David Howells 2016-09-08 388 call->tx_winsize) a4ea4c47761943 David Howells 2022-03-31 389 txb->wire.flags |= RXRPC_MORE_PACKETS; 0b58b8a18be493 David Howells 2016-09-02 390 a4ea4c47761943 David Howells 2022-03-31 391 ret = call->security->secure_packet(call, txb); 0b58b8a18be493 David Howells 2016-09-02 392 if (ret < 0) 0b58b8a18be493 David Howells 2016-09-02 393 goto out; 0b58b8a18be493 David Howells 2016-09-02 394 a4ea4c47761943 David Howells 2022-03-31 395 rxrpc_queue_packet(rx, call, txb, notify_end_tx); a4ea4c47761943 David Howells 2022-03-31 396 txb = NULL; 0b58b8a18be493 David Howells 2016-09-02 397 } 0b58b8a18be493 David Howells 2016-09-02 398 } while (msg_data_left(msg) > 0); 0b58b8a18be493 David Howells 2016-09-02 399 0b58b8a18be493 David Howells 2016-09-02 400 success: 0b58b8a18be493 David Howells 2016-09-02 401 ret = copied; 4ba68c51925548 David Howells 2022-05-21 402 if (READ_ONCE(call->state) == RXRPC_CALL_COMPLETE) { 4ba68c51925548 David Howells 2022-05-21 403 read_lock_bh(&call->state_lock); 4ba68c51925548 David Howells 2022-05-21 404 if (call->error < 0) 4ba68c51925548 David Howells 2022-05-21 405 ret = call->error; 4ba68c51925548 David Howells 2022-05-21 406 read_unlock_bh(&call->state_lock); 4ba68c51925548 David Howells 2022-05-21 407 } 0b58b8a18be493 David Howells 2016-09-02 408 out: a4ea4c47761943 David Howells 2022-03-31 @409 call->tx_pending = txb; 0b58b8a18be493 David Howells 2016-09-02 410 _leave(" = %d", ret); 0b58b8a18be493 David Howells 2016-09-02 411 return ret; 0b58b8a18be493 David Howells 2016-09-02 412 e122d845a01ece David Howells 2019-01-10 413 call_terminated: a4ea4c47761943 David Howells 2022-03-31 414 rxrpc_put_txbuf(txb, rxrpc_txbuf_put_send_aborted); e122d845a01ece David Howells 2019-01-10 415 _leave(" = %d", call->error); e122d845a01ece David Howells 2019-01-10 416 return call->error; e122d845a01ece David Howells 2019-01-10 417 0b58b8a18be493 David Howells 2016-09-02 418 maybe_error: 0b58b8a18be493 David Howells 2016-09-02 419 if (copied) 0b58b8a18be493 David Howells 2016-09-02 420 goto success; 0b58b8a18be493 David Howells 2016-09-02 421 goto out; 0b58b8a18be493 David Howells 2016-09-02 422 0b58b8a18be493 David Howells 2016-09-02 423 efault: 0b58b8a18be493 David Howells 2016-09-02 424 ret = -EFAULT; 0b58b8a18be493 David Howells 2016-09-02 425 goto out; b0f571ecd79434 David Howells 2022-08-24 426 b0f571ecd79434 David Howells 2022-08-24 427 wait_for_space: b0f571ecd79434 David Howells 2022-08-24 428 ret = -EAGAIN; b0f571ecd79434 David Howells 2022-08-24 429 if (msg->msg_flags & MSG_DONTWAIT) b0f571ecd79434 David Howells 2022-08-24 430 goto maybe_error; b0f571ecd79434 David Howells 2022-08-24 431 mutex_unlock(&call->user_mutex); b0f571ecd79434 David Howells 2022-08-24 432 *_dropped_lock = true; b0f571ecd79434 David Howells 2022-08-24 433 ret = rxrpc_wait_for_tx_window(rx, call, &timeo, b0f571ecd79434 David Howells 2022-08-24 434 msg->msg_flags & MSG_WAITALL); b0f571ecd79434 David Howells 2022-08-24 435 if (ret < 0) b0f571ecd79434 David Howells 2022-08-24 436 goto maybe_error; b0f571ecd79434 David Howells 2022-08-24 437 if (call->interruptibility == RXRPC_INTERRUPTIBLE) { b0f571ecd79434 David Howells 2022-08-24 438 if (mutex_lock_interruptible(&call->user_mutex) < 0) { b0f571ecd79434 David Howells 2022-08-24 439 ret = sock_intr_errno(timeo); b0f571ecd79434 David Howells 2022-08-24 440 goto maybe_error; b0f571ecd79434 David Howells 2022-08-24 441 } b0f571ecd79434 David Howells 2022-08-24 442 } else { b0f571ecd79434 David Howells 2022-08-24 443 mutex_lock(&call->user_mutex); b0f571ecd79434 David Howells 2022-08-24 444 } b0f571ecd79434 David Howells 2022-08-24 445 *_dropped_lock = false; b0f571ecd79434 David Howells 2022-08-24 446 goto reload; 0b58b8a18be493 David Howells 2016-09-02 447 } df423a4af125f5 David Howells 2016-09-02 448 -- 0-DAY CI Kernel Test Service https://01.org/lkp