Skip to content

Commit

Permalink
hw-breakpoints: Zeroe the breakpoint attrs on initialization
Browse files Browse the repository at this point in the history
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 <fweisbec@gmail.com>
Cc: Prasad <prasad@linux.vnet.ibm.com>
  • Loading branch information
Frederic Weisbecker committed Dec 7, 2009
1 parent b9b1e1c commit ed872d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/hw_breakpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
/*
Expand Down

0 comments on commit ed872d0

Please sign in to comment.