Skip to content

Commit

Permalink
10749 rpcmod: NULL pointer errors
Browse files Browse the repository at this point in the history
Reviewed by: Marcel Telka <marcel@telka.sk>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
  • Loading branch information
tsoome committed Apr 19, 2019
1 parent a7b1854 commit 25c9576
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
8 changes: 4 additions & 4 deletions usr/src/uts/common/rpc/rdma_subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ clist_zero_len(struct clist *cl)
*/
void
clist_add(struct clist **clp, uint32_t xdroff, int len,
struct mrc *shandle, caddr_t saddr,
struct mrc *dhandle, caddr_t daddr)
struct mrc *shandle, caddr_t saddr,
struct mrc *dhandle, caddr_t daddr)
{
struct clist *cl;

Expand Down Expand Up @@ -312,7 +312,7 @@ clist_deregister(CONN *conn, struct clist *cl)
(void *)(uintptr_t)c->c_ssynchandle,
(void *)c->rb_longbuf.rb_private);
c->c_smemhandle.mrc_rmr = 0;
c->c_ssynchandle = NULL;
c->c_ssynchandle = 0;
}
break;
case CLIST_REG_DST:
Expand All @@ -323,7 +323,7 @@ clist_deregister(CONN *conn, struct clist *cl)
(void *)(uintptr_t)c->c_dsynchandle,
(void *)c->rb_longbuf.rb_private);
c->c_dmemhandle.mrc_rmr = 0;
c->c_dsynchandle = NULL;
c->c_dsynchandle = 0;
}
break;
default:
Expand Down
13 changes: 5 additions & 8 deletions usr/src/uts/common/rpc/rpc_subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/

/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/* All Rights Reserved */


/*
Expand Down Expand Up @@ -79,7 +79,7 @@ static void loopb_u2t(const char *, struct netbuf *);
* mask which allows various types of debugging messages to be printed
* out.
*
* rpclog & 1 will cause actual failures to be printed.
* rpclog & 1 will cause actual failures to be printed.
* rpclog & 2 will cause informational messages to be
* printed on the client side of rpc.
* rpclog & 4 will cause informational messages to be
Expand Down Expand Up @@ -372,7 +372,7 @@ loopb_u2t(const char *ua, struct netbuf *addr)

univp = ua;
transp = addr->buf;
while (*univp != NULL) {
while (*univp != '\0') {
if (*univp == '\\' && *(univp+1) == '\\') {
*transp = '\\';
univp += 2;
Expand Down Expand Up @@ -597,7 +597,7 @@ rpcbind_getaddr(struct knetconfig *config, rpcprog_t prog, rpcvers_t vers,
clnt_destroy(client);

if (status == RPC_SUCCESS) {
if (ua == NULL || *ua == NULL) {
if (ua == NULL || *ua == '\0') {
status = RPC_PROGNOTREGISTERED;
continue;
}
Expand Down Expand Up @@ -738,10 +738,7 @@ rpc_tpierr2name(uint_t err)
#define IN6ADDRSZ 16
#define INT16SZ 2
const char *
kinet_ntop6(src, dst, size)
uchar_t *src;
char *dst;
size_t size;
kinet_ntop6(uchar_t *src, char *dst, size_t size)
{
/*
* Note that int32_t and int16_t need only be "at least" large enough
Expand Down
2 changes: 1 addition & 1 deletion usr/src/uts/common/rpc/svc_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ svc_rdma_krecv(SVCXPRT *clone_xprt, mblk_t *mp, struct rpc_msg *msg)

cllong->u.c_daddr3 = cllong->rb_longbuf.addr;

if (cllong->u.c_daddr == NULL) {
if (cllong->u.c_daddr == 0) {
DTRACE_PROBE(krpc__e__svcrdma__krecv__nomem);
rdma_buf_free(conn, &cllong->rb_longbuf);
clist_free(cllong);
Expand Down

0 comments on commit 25c9576

Please sign in to comment.