Skip to contentSkip to conversation

SUNRPC: Fail over more quickly on connect errors

DISCUSSION Dan Carpenter 1 participant 1 message May 22, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

I'm going through some smatch stuff and it complains about a potential null dereference from a8ce4a8f37: "SUNRPC: Fail over more quickly on connect errors"

net/sunrpc/xprt.c +0 -0
@@ -710,7 +710,7 @@ void xprt_connect(struct rpc_task *task)
                if (task->tk_rqstp)
                ^^^^^^^^^^^^^^^^^^^
 
	We assume task->tk_rqstp can be null here.

                        task->tk_rqstp->rq_bytes_sent = 0;

- task->tk_timeout = xprt->connect_timeout;

+               task->tk_timeout = task->tk_rqstp->rq_timeout;
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^

	We dereference it here.

                rpc_sleep_on(&xprt->pending, task, xprt_connect_status);
 
                if (test_bit(XPRT_CLOSING, &xprt->state))

regards,
dan carpenter