diff options
author | Eric Van Hensbergen <ericvh@gmail.com> | 2011-07-13 20:12:18 -0400 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2011-07-23 10:32:29 -0400 |
commit | b85f7d92d7bd7e3298159e8b1eed8cb8cbbb0348 (patch) | |
tree | 3abd3117770a4cca95e442d248d4da187ad8aa7d /net | |
parent | bbd9d6f7fbb0305c9a592bf05a32e87eb364a4ff (diff) |
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.
Reported-by: Natalie Orlin <norlin@us.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/9p/client.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index 9e3b0e640da1..81e667b6bbbd 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -280,7 +280,8 @@ struct p9_req_t *p9_tag_lookup(struct p9_client *c, u16 tag) | |||
280 | * buffer to read the data into */ | 280 | * buffer to read the data into */ |
281 | tag++; | 281 | tag++; |
282 | 282 | ||
283 | BUG_ON(tag >= c->max_tag); | 283 | if(tag >= c->max_tag) |
284 | return NULL; | ||
284 | 285 | ||
285 | row = tag / P9_ROW_MAXTAG; | 286 | row = tag / P9_ROW_MAXTAG; |
286 | col = tag % P9_ROW_MAXTAG; | 287 | col = tag % P9_ROW_MAXTAG; |