blob: 6e3f6cbafe8e55a2a5de339aae9f6a04a206e00c [file] [log] [blame]
From b8b7789a2b1148fb155bbe0e79dfd5efcdf18171 Mon Sep 17 00:00:00 2001
From: Eric Van Hensbergen <ericvh@gmail.com>
Date: Wed, 13 Jul 2011 19:12:18 -0500
Subject: [PATCH] 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 <norlin@us.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
diff --git a/net/9p/client.c b/net/9p/client.c
index 0aa79fa..f7bf503 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;
--
1.7.12.rc1.1.gbce1580