Skip to contentSkip to conversation

net/9p: fid->fid is used uninitialized

PATCH Applied Roel Kluin 2 participants 2 messages Jan 18, 2009 – Jan 19, 2009 9P file system

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 net/9p: fid->fid is used uninitialized

I appear to have introduced this myself trying to fix a signed/unsigned issue, sorry.
---
fid->fid is used uninitialized

---

net/9p/client.c +1 -1
index 821f1ec..1eb580c 100644
@@ -618,7 +618,7 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt)
 		return ERR_PTR(-ENOMEM);
 
 	ret = p9_idpool_get(clnt->fidpool);
-	if (fid->fid < 0) {
+	if (ret < 0) {
 		ret = -ENOSPC;
 		goto error;
 	}
Applied
#1 lore raw

From: Roel Kluin <[email protected]>
Date: Sun, 18 Jan 2009 20:10:25 +0100

Quoted 3 lines

fid->fid is used uninitialized

Applied, thanks Roel.

Someone should look into how p9_idpool_get() errors are propagated. Another call site uses -ENOBUFS, this location uses -ENOSPC, and it begs the question whether we should just use the error return given by p9_idpool_get() across the board.