diff options
author | Seth Jennings <sjenning@linux.vnet.ibm.com> | 2012-07-18 11:55:55 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-13 19:28:08 -0700 |
commit | c60369f011251c60de506994aab088f1afb90bf4 (patch) | |
tree | 5c3f5a5495937abf9923f8eb430fffa1e7e6c47d /drivers/staging/zsmalloc | |
parent | 6539a36c0cb9ec7f1c1633b535ac83b2bdf0ae6d (diff) |
staging: zsmalloc: prevent mappping in interrupt context
Because we use per-cpu mapping areas shared among the
pools/users, we can't allow mapping in interrupt context
because it can corrupt another users mappings.
Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/zsmalloc')
-rw-r--r-- | drivers/staging/zsmalloc/zsmalloc-main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/staging/zsmalloc/zsmalloc-main.c b/drivers/staging/zsmalloc/zsmalloc-main.c index 3c83c65ca5b8..b86133fdc2c8 100644 --- a/drivers/staging/zsmalloc/zsmalloc-main.c +++ b/drivers/staging/zsmalloc/zsmalloc-main.c @@ -75,6 +75,7 @@ #include <linux/cpumask.h> #include <linux/cpu.h> #include <linux/vmalloc.h> +#include <linux/hardirq.h> #include "zsmalloc.h" #include "zsmalloc_int.h" @@ -761,6 +762,13 @@ void *zs_map_object(struct zs_pool *pool, unsigned long handle, BUG_ON(!handle); + /* + * Because we use per-cpu mapping areas shared among the + * pools/users, we can't allow mapping in interrupt context + * because it can corrupt another users mappings. + */ + BUG_ON(in_interrupt()); + obj_handle_to_location(handle, &page, &obj_idx); get_zspage_mapping(get_first_page(page), &class_idx, &fg); class = &pool->size_class[class_idx]; |