summaryrefslogtreecommitdiff
path: root/include/linux/cpumask.h
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2011-09-08 01:18:36 +0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-09-08 01:18:36 +0400
commit7e66eaf14e19c032433be7c4df3c892fa2a5282f (patch)
tree56b0d5f9d16eb18744e102f3f216715196cd62e6 /include/linux/cpumask.h
parentd3654d7ef3adad0083525cfb6fe27be62cb83d0d (diff)
parentc6a389f123b9f68d605bb7e0f9b32ec1e3e14132 (diff)
downloadlinux-7e66eaf14e19c032433be7c4df3c892fa2a5282f.tar.xz
Merge commit 'v3.1-rc4' into next
Diffstat (limited to 'include/linux/cpumask.h')
-rw-r--r--include/linux/cpumask.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index b24ac56477b4..4f7a63237471 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -617,6 +617,20 @@ static inline size_t cpumask_size(void)
* ... use 'tmpmask' like a normal struct cpumask * ...
*
* free_cpumask_var(tmpmask);
+ *
+ *
+ * However, one notable exception is there. alloc_cpumask_var() allocates
+ * only nr_cpumask_bits bits (in the other hand, real cpumask_t always has
+ * NR_CPUS bits). Therefore you don't have to dereference cpumask_var_t.
+ *
+ * cpumask_var_t tmpmask;
+ * if (!alloc_cpumask_var(&tmpmask, GFP_KERNEL))
+ * return -ENOMEM;
+ *
+ * var = *tmpmask;
+ *
+ * This code makes NR_CPUS length memcopy and brings to a memory corruption.
+ * cpumask_copy() provide safe copy functionality.
*/
#ifdef CONFIG_CPUMASK_OFFSTACK
typedef struct cpumask *cpumask_var_t;