Эх сурвалжийг харах

NFS: silence a uninitialized variable warning

Static checkers have gotten clever enough to complain that "id_long" is
uninitialized on the failure path.  It's harmless, but simple to fix.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Dan Carpenter 8 жил өмнө
parent
commit
4cd1ec95bd

+ 2 - 1
fs/nfs/nfs4idmap.c

@@ -364,7 +364,8 @@ static int nfs_idmap_lookup_id(const char *name, size_t namelen, const char *typ
 		ret = -EINVAL;
 		ret = -EINVAL;
 	} else {
 	} else {
 		ret = kstrtol(id_str, 10, &id_long);
 		ret = kstrtol(id_str, 10, &id_long);
-		*id = (__u32)id_long;
+		if (!ret)
+			*id = (__u32)id_long;
 	}
 	}
 	return ret;
 	return ret;
 }
 }