Skip to content

Commit 0246d0a

Browse files
zhangqingmychenhuacai
authored andcommitted
LoongArch: Avoid uninitialized alignment_mask
The hardware monitoring points for instruction fetching and load/store operations need to align 4 bytes and 1/2/4/8 bytes respectively. Reported-by: Colin King <[email protected]> Signed-off-by: Qing Zhang <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent 9623691 commit 0246d0a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/loongarch/kernel/hw_breakpoint.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,8 @@ int hw_breakpoint_arch_parse(struct perf_event *bp,
396396

397397
if (hw->ctrl.type != LOONGARCH_BREAKPOINT_EXECUTE)
398398
alignment_mask = 0x7;
399+
else
400+
alignment_mask = 0x3;
399401
offset = hw->address & alignment_mask;
400402

401403
hw->address &= ~alignment_mask;

0 commit comments

Comments
 (0)