Skip to content

Commit

Permalink
net/9p: fix client code to fail more gracefully on protocol error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Van Hensbergen committed Jul 23, 2011
1 parent bbd9d6f commit b85f7d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/9p/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b85f7d9

Please sign in to comment.