Skip to content

Commit 4fc5f53

Browse files
Jakob-Koschelchucklever
authored andcommitted
nfsd: fix using the correct variable for sizeof()
While the original code is valid, it is not the obvious choice for the sizeof() call and in preparation to limit the scope of the list iterator variable the sizeof should be changed to the size of the destination. Signed-off-by: Jakob Koschel <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 4e1b04a commit 4fc5f53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfsd/nfs4layouts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ nfsd4_insert_layout(struct nfsd4_layoutget *lgp, struct nfs4_layout_stateid *ls)
422422
new = kmem_cache_alloc(nfs4_layout_cache, GFP_KERNEL);
423423
if (!new)
424424
return nfserr_jukebox;
425-
memcpy(&new->lo_seg, seg, sizeof(lp->lo_seg));
425+
memcpy(&new->lo_seg, seg, sizeof(new->lo_seg));
426426
new->lo_state = ls;
427427

428428
spin_lock(&fp->fi_lock);

0 commit comments

Comments
 (0)