aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/host.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/lockd/host.c')
-rw-r--r--fs/lockd/host.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 3ce2702d0368..510ebcf485f0 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -551,7 +551,7 @@ retry:
551 if (strlen(pos->sm_name) != hostname_len 551 if (strlen(pos->sm_name) != hostname_len
552 || memcmp(pos->sm_name, hostname, hostname_len)) 552 || memcmp(pos->sm_name, hostname, hostname_len))
553 continue; 553 continue;
554 } else if (!nlm_cmp_addr(&pos->sm_addr, sin)) 554 } else if (!nlm_cmp_addr(nsm_addr_in(pos), sin))
555 continue; 555 continue;
556 atomic_inc(&pos->sm_count); 556 atomic_inc(&pos->sm_count);
557 kfree(nsm); 557 kfree(nsm);
@@ -571,7 +571,8 @@ retry:
571 if (nsm == NULL) 571 if (nsm == NULL)
572 return NULL; 572 return NULL;
573 573
574 nsm->sm_addr = *sin; 574 memcpy(nsm_addr(nsm), sin, sizeof(*sin));
575 nsm->sm_addrlen = sizeof(*sin);
575 nsm->sm_name = (char *) (nsm + 1); 576 nsm->sm_name = (char *) (nsm + 1);
576 memcpy(nsm->sm_name, hostname, hostname_len); 577 memcpy(nsm->sm_name, hostname, hostname_len);
577 nsm->sm_name[hostname_len] = '\0'; 578 nsm->sm_name[hostname_len] = '\0';