From 049de1844bb509dc933086177d5eec1f2bc34af2 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 30 May 2013 09:19:35 +0200 Subject: [PATCH] --- yaml --- r: 376996 b: refs/heads/master c: ac4e97abce9b80c020e7113325f49e58b7b15e3f h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/scatterlist.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index b15bdbd88dca..507be9f5f097 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4997b72ee62930cb841d185398ea547d979789f4 +refs/heads/master: ac4e97abce9b80c020e7113325f49e58b7b15e3f diff --git a/trunk/include/linux/scatterlist.h b/trunk/include/linux/scatterlist.h index 5951e3f38878..26806775b11b 100644 --- a/trunk/include/linux/scatterlist.h +++ b/trunk/include/linux/scatterlist.h @@ -111,6 +111,9 @@ static inline struct page *sg_page(struct scatterlist *sg) static inline void sg_set_buf(struct scatterlist *sg, const void *buf, unsigned int buflen) { +#ifdef CONFIG_DEBUG_SG + BUG_ON(!virt_addr_valid(buf)); +#endif sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); }