Skip to contentSkip to conversation

Use kzalloc instead of kcalloc in kernel/kprobes.c

PATCH New Luca Falavigna 1 participant 1 message Oct 20, 2005 kprobes

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use kzalloc instead of kcalloc in kernel/kprobes.c

This trivial patch, compiled against kernel version 2.6.14-rc5, substitutes kcalloc with kzalloc in kernel/kprobes.c

kernel/kprobes.c +2 -2
@@ -418,7 +418,7 @@ static inline void add_aggr_kprobe(struc
 /*
  * This is the second or subsequent kprobe at the address - handle
  * the intricacies
- * TODO: Move kcalloc outside the spinlock
+ * TODO: Move kzalloc outside the spinlock
  */
 static int __kprobes register_aggr_kprobe(struct kprobe *old_p,
 					  struct kprobe *p)
@@ -430,7 +430,7 @@ static int __kprobes register_aggr_kprob
 		copy_kprobe(old_p, p);
 		ret = add_new_kprobe(old_p, p);
 	} else {
-		ap = kcalloc(1, sizeof(struct kprobe), GFP_ATOMIC);
+		ap = kzalloc(sizeof(struct kprobe), GFP_ATOMIC);
 		if (!ap)
 			return -ENOMEM;
 		add_aggr_kprobe(ap, old_p);

Regards,
--
Luca