[sheepdog] [PATCH] sdnet: use xzalloc for alloc_local_request()

Liu Yuan namei.unix at gmail.com
Wed Jul 4 11:39:43 CEST 2012


From: Liu Yuan <tailai.ly at taobao.com>

If we can't afford NULL req, we should panic out.
Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/sdnet.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sheep/sdnet.c b/sheep/sdnet.c
index 71bf0fd..df5b4e9 100644
--- a/sheep/sdnet.c
+++ b/sheep/sdnet.c
@@ -390,7 +390,7 @@ static struct request *alloc_local_request(void *data, int data_length)
 {
 	struct request *req;
 
-	req = zalloc(sizeof(struct request));
+	req = xzalloc(sizeof(struct request));
 	if (data_length) {
 		req->data_length = data_length;
 		req->data = data;
-- 
1.7.10.2




More information about the sheepdog mailing list