Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed872d09 authored by Frederic Weisbecker's avatar Frederic Weisbecker
Browse files

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: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Cc: Prasad <prasad@linux.vnet.ibm.com>
parent b9b1e1c7
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -22,6 +22,8 @@ enum {


static inline void hw_breakpoint_init(struct perf_event_attr *attr)
static inline void hw_breakpoint_init(struct perf_event_attr *attr)
{
{
	memset(attr, 0, sizeof(*attr));

	attr->type = PERF_TYPE_BREAKPOINT;
	attr->type = PERF_TYPE_BREAKPOINT;
	attr->size = sizeof(*attr);
	attr->size = sizeof(*attr);
	/*
	/*