• NeilBrown's avatar
    SUNRPC: handle malloc failure in ->request_prepare · eb07d5a4
    NeilBrown authored
    If ->request_prepare() detects an error, it sets ->rq_task->tk_status.
    This is easy for callers to ignore.
    The only caller is xprt_request_enqueue_receive() and it does ignore the
    error, as does call_encode() which calls it.  This can result in a
    request being queued to receive a reply without an allocated receive buffer.
    
    So instead of setting rq_task->tk_status, return an error, and store in
    ->tk_status only in call_encode();
    
    The call to xprt_request_enqueue_receive() is now earlier in
    call_encode(), where the error can still be handled.
    Signed-off-by: default avatarNeilBrown <neilb@suse.de>
    Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
    eb07d5a4
xprtsock.c 82.6 KB