Skip to contentSkip to conversation

net/9p: fix client code to fail more gracefully on protocol error

PATCH New Eric Van Hensbergen 1 participant 1 message Jul 14, 2011 9P file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/9p: fix client code to fail more gracefully on protocol error

There was a BUG_ON to protect against a bad id which could be dealt with more gracefully.

---
 net/9p/client.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/9p/client.c +2 -1
index 9e3b0e6..81e667b 100644
@@ -280,7 +280,8 @@ struct p9_req_t *p9_tag_lookup(struct p9_client *c, u16 tag)
 	 * buffer to read the data into */
 	tag++;
 
-	BUG_ON(tag >= c->max_tag);
+	if(tag >= c->max_tag) 
+		return NULL;
 
 	row = tag / P9_ROW_MAXTAG;
 	col = tag % P9_ROW_MAXTAG;
Signature · 1 line
1.7.4.1