summaryrefslogtreecommitdiff
path: root/drivers/staging/ramster/zcache.h
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-09-06 12:40:20 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-06 16:25:22 (GMT)
commitf0290de23de19b592b2934cdf21c0c0c2eb16500 (patch)
tree023beca4851a086625c2f8b404ee85a23e6cad75 /drivers/staging/ramster/zcache.h
parentd08d6cfe3b594b797e1204891613d1cdf70fb0c7 (diff)
downloadlinux-fsl-qoriq-f0290de23de19b592b2934cdf21c0c0c2eb16500.tar.xz
staging: ramster: fix range checks in zcache_autocreate_pool()
If "pool_id" is negative then it leads to a read before the start of the array. If "cli_id" is out of bounds then it leads to a NULL dereference of "cli". GCC would have warned about that bug except that we initialized the warning message away. Also it's better to put the parameter names into the function declaration in the .h file. It serves as a kind of documentation. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ramster/zcache.h')
-rw-r--r--drivers/staging/ramster/zcache.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/ramster/zcache.h b/drivers/staging/ramster/zcache.h
index c59666e..81722b3 100644
--- a/drivers/staging/ramster/zcache.h
+++ b/drivers/staging/ramster/zcache.h
@@ -42,7 +42,7 @@ extern void zcache_decompress_to_page(char *, unsigned int, struct page *);
#ifdef CONFIG_RAMSTER
extern void *zcache_pampd_create(char *, unsigned int, bool, int,
struct tmem_handle *);
-extern int zcache_autocreate_pool(int, int, bool);
+int zcache_autocreate_pool(unsigned int cli_id, unsigned int pool_id, bool eph);
#endif
#define MAX_POOLS_PER_CLIENT 16