Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFSD: Take care the return value from nfsd4_decode_stateid

Return status after nfsd4_decode_stateid failed.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>

authored by

Kinglong Mee and committed by
J. Bruce Fields
db59c0ef 6f8f28ec

+15 -3
+15 -3
fs/nfsd/nfs4xdr.c
··· 1562 1562 p = xdr_decode_hyper(p, &lgp->lg_seg.offset); 1563 1563 p = xdr_decode_hyper(p, &lgp->lg_seg.length); 1564 1564 p = xdr_decode_hyper(p, &lgp->lg_minlength); 1565 - nfsd4_decode_stateid(argp, &lgp->lg_sid); 1565 + 1566 + status = nfsd4_decode_stateid(argp, &lgp->lg_sid); 1567 + if (status) 1568 + return status; 1569 + 1566 1570 READ_BUF(4); 1567 1571 lgp->lg_maxcount = be32_to_cpup(p++); 1568 1572 ··· 1584 1580 p = xdr_decode_hyper(p, &lcp->lc_seg.offset); 1585 1581 p = xdr_decode_hyper(p, &lcp->lc_seg.length); 1586 1582 lcp->lc_reclaim = be32_to_cpup(p++); 1587 - nfsd4_decode_stateid(argp, &lcp->lc_sid); 1583 + 1584 + status = nfsd4_decode_stateid(argp, &lcp->lc_sid); 1585 + if (status) 1586 + return status; 1587 + 1588 1588 READ_BUF(4); 1589 1589 lcp->lc_newoffset = be32_to_cpup(p++); 1590 1590 if (lcp->lc_newoffset) { ··· 1636 1628 READ_BUF(16); 1637 1629 p = xdr_decode_hyper(p, &lrp->lr_seg.offset); 1638 1630 p = xdr_decode_hyper(p, &lrp->lr_seg.length); 1639 - nfsd4_decode_stateid(argp, &lrp->lr_sid); 1631 + 1632 + status = nfsd4_decode_stateid(argp, &lrp->lr_sid); 1633 + if (status) 1634 + return status; 1635 + 1640 1636 READ_BUF(4); 1641 1637 lrp->lrf_body_len = be32_to_cpup(p++); 1642 1638 if (lrp->lrf_body_len > 0) {