From: Frederic Weisbecker Date: Mon, 7 Dec 2009 02:14:17 +0000 (+0100) Subject: hw-breakpoints: Zeroe the breakpoint attrs on initialization X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ed872d09effd54aa8ecb4ceedbc4dbab9592f337;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git hw-breakpoints: Zeroe the breakpoint attrs on initialization The perf attrs used to set up breakpoint parameters are often allocated in the stack and not zeroed out before calling hw_breakpoint_init(). Handle it from this helper to avoid random attributes set by the stack. Signed-off-by: Frederic Weisbecker Cc: Prasad --- diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index 4d14a384a01e..42da1ce19ec0 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h @@ -22,6 +22,8 @@ enum { static inline void hw_breakpoint_init(struct perf_event_attr *attr) { + memset(attr, 0, sizeof(*attr)); + attr->type = PERF_TYPE_BREAKPOINT; attr->size = sizeof(*attr); /*