diff options
author | das <das@FreeBSD.org> | 2005-03-19 01:16:25 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2005-03-19 01:16:25 +0000 |
commit | 31c93905951577d0d5b5d493113cac6240d8ff08 (patch) | |
tree | 5a9cb195ba5864b0f022d9d8fe435baff1cee029 /sys/rpc | |
parent | d09e0745dc1e16ab273c083997d78e65afaad4d8 (diff) | |
download | FreeBSD-src-31c93905951577d0d5b5d493113cac6240d8ff08.zip FreeBSD-src-31c93905951577d0d5b5d493113cac6240d8ff08.tar.gz |
- Don't call rpcclnt_realign() if we don't have any mbufs to realign.
- Remove a bogus and unneeded null pointer check.
Found by: Coverity Prevent analysis tool
Approved by: alfred
Diffstat (limited to 'sys/rpc')
-rw-r--r-- | sys/rpc/rpcclnt.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/sys/rpc/rpcclnt.c b/sys/rpc/rpcclnt.c index d50ec42..3c32e5c 100644 --- a/sys/rpc/rpcclnt.c +++ b/sys/rpc/rpcclnt.c @@ -943,15 +943,15 @@ errout: if (error) { m_freem(*mp); *mp = NULL; - } - - /* - * Search for any mbufs that are not a multiple of 4 bytes - * long or with m_data not longword aligned. These could - * cause pointer alignment problems, so copy them to well - * aligned mbufs. - */ - rpcclnt_realign(mp, 5 * RPCX_UNSIGNED); + } else { + /* + * Search for any mbufs that are not a multiple of 4 bytes + * long or with m_data not longword aligned. These could + * cause pointer alignment problems, so copy them to well + * aligned mbufs. + */ + rpcclnt_realign(mp, 5 * RPCX_UNSIGNED); + } RPC_RETURN(error); } @@ -1547,12 +1547,9 @@ rpcclnt_sndlock(flagp, task) RPC_EXEC_CTX p; int slpflag = 0, slptimeo = 0; - if (task) { - p = task->r_td; - if (task->r_rpcclnt->rc_flag & RPCCLNT_INT) - slpflag = PCATCH; - } else - p = NULL; + p = task->r_td; + if (task->r_rpcclnt->rc_flag & RPCCLNT_INT) + slpflag = PCATCH; while (*flagp & RPCCLNT_SNDLOCK) { if (rpcclnt_sigintr(task->r_rpcclnt, task, p)) RPC_RETURN(EINTR); |