Patchwork [Bug,#15196] kmem_cache_create: duplicate cache ccid2_h

login
register
mail settings
Submitter Heinz Diehl
Date Feb. 7, 2010, 10:54 a.m.
Message ID <20100207105448.GA6623@fancy-poultry.org>
Download mbox | patch
Permalink /patch/77601/
State New, archived
Headers show

Comments

Patch

--- /a/ccid.c	2010-02-06 23:17:12.000000000 +0100
+++ /b/ccid.c	2010-02-07 09:50:40.000000000 +0100
@@ -77,13 +77,13 @@ 
 	return err;
 }
 
-static struct kmem_cache *ccid_kmem_cache_create(int obj_size, char *slab_name_fmt, const char *fmt,...)
+static struct kmem_cache *ccid_kmem_cache_create(int obj_size, char *slab_name_fmt, int length, const char *fmt,...)
 {
 	struct kmem_cache *slab;
 	va_list args;
 
 	va_start(args, fmt);
-	vsnprintf(slab_name_fmt, sizeof(slab_name_fmt), fmt, args);
+	vsnprintf(slab_name_fmt, length, fmt, args);
 	va_end(args);
 
 	slab = kmem_cache_create(slab_name_fmt, sizeof(struct ccid) + obj_size, 0,
@@ -104,6 +104,7 @@ 
 	ccid_ops->ccid_hc_rx_slab =
 			ccid_kmem_cache_create(ccid_ops->ccid_hc_rx_obj_size,
 					       ccid_ops->ccid_hc_rx_slab_name,
+					       sizeof(ccid_ops->ccid_hc_rx_slab_name),
 					       "ccid%u_hc_rx_sock",
 					       ccid_ops->ccid_id);
 	if (ccid_ops->ccid_hc_rx_slab == NULL)
@@ -112,6 +113,7 @@ 
 	ccid_ops->ccid_hc_tx_slab =
 			ccid_kmem_cache_create(ccid_ops->ccid_hc_tx_obj_size,
 					       ccid_ops->ccid_hc_tx_slab_name,
+					       sizeof(ccid_ops->ccid_hc_tx_slab_name),
 					       "ccid%u_hc_tx_sock",
 					       ccid_ops->ccid_id);
 	if (ccid_ops->ccid_hc_tx_slab == NULL)