]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
net/9p: fix client code to fail more gracefully on protocol error
authorEric Van Hensbergen <ericvh@gmail.com>
Thu, 14 Jul 2011 00:12:18 +0000 (19:12 -0500)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Fri, 17 Aug 2012 19:35:12 +0000 (15:35 -0400)
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 <norlin@us.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
net/9p/client.c

index 0aa79faa98509a1d91f71cec5c307f3522c2a58d..583fd03fe56ca33702dceb9f93e155ce327528e4 100644 (file)
@@ -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;