fs/afs/vlocation.c: fix off-by-one
This patch fixes an off-by-one error spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@kernel.org> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
f11b7ae8d6
commit
6551198a20
1 changed files with 1 additions and 1 deletions
|
@ -382,7 +382,7 @@ struct afs_vlocation *afs_vlocation_lookup(struct afs_cell *cell,
|
||||||
cell->name, key_serial(key),
|
cell->name, key_serial(key),
|
||||||
(int) namesz, (int) namesz, name, namesz);
|
(int) namesz, (int) namesz, name, namesz);
|
||||||
|
|
||||||
if (namesz > sizeof(vl->vldb.name)) {
|
if (namesz >= sizeof(vl->vldb.name)) {
|
||||||
_leave(" = -ENAMETOOLONG");
|
_leave(" = -ENAMETOOLONG");
|
||||||
return ERR_PTR(-ENAMETOOLONG);
|
return ERR_PTR(-ENAMETOOLONG);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue