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 <colin.i.king@gmail.com> Signed-off-by: Qing Zhang <zhangqing@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent 9623691 commit 0246d0a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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)