From: Eric Van Hensbergen Date: Thu, 14 Jul 2011 00:12:18 +0000 (-0500) Subject: net/9p: fix client code to fail more gracefully on protocol error X-Git-Tag: v2.6.34.13~134 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5e09270b0da603e9b49162f414993cd53db00548;p=thirdparty%2Fkernel%2Fstable.git net/9p: fix client code to fail more gracefully on protocol error commit b85f7d92d7bd7e3298159e8b1eed8cb8cbbb0348 upstream. There was a BUG_ON to protect against a bad id which could be dealt with more gracefully. Reported-by: Natalie Orlin Signed-off-by: Eric Van Hensbergen Signed-off-by: Paul Gortmaker --- diff --git a/net/9p/client.c b/net/9p/client.c index 0aa79faa98509..583fd03fe56ca 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -272,7 +272,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;