Skip to content

Commit

Permalink
nfs: Keep index within mnt_errtbl[]
Browse files Browse the repository at this point in the history
Ensure that index i remains within array mnt_errtbl[] and mnt3_errtbl[].

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Roel Kluin authored and Trond Myklebust committed Aug 9, 2009
1 parent 7b2aa03 commit dd8ac1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/nfs/mount_clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ static int decode_status(struct xdr_stream *xdr, struct mountres *res)
return -EIO;
status = ntohl(*p);

for (i = 0; i <= ARRAY_SIZE(mnt_errtbl); i++) {
for (i = 0; i < ARRAY_SIZE(mnt_errtbl); i++) {
if (mnt_errtbl[i].status == status) {
res->errno = mnt_errtbl[i].errno;
return 0;
Expand Down Expand Up @@ -309,7 +309,7 @@ static int decode_fhs_status(struct xdr_stream *xdr, struct mountres *res)
return -EIO;
status = ntohl(*p);

for (i = 0; i <= ARRAY_SIZE(mnt3_errtbl); i++) {
for (i = 0; i < ARRAY_SIZE(mnt3_errtbl); i++) {
if (mnt3_errtbl[i].status == status) {
res->errno = mnt3_errtbl[i].errno;
return 0;
Expand Down

0 comments on commit dd8ac1d

Please sign in to comment.