hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/kernel/debug/kdb/kdb_bp.c
....@@ -307,6 +307,15 @@
307307 return KDB_BADINT;
308308
309309 /*
310
+ * This check is redundant (since the breakpoint machinery should
311
+ * be doing the same check during kdb_bp_install) but gives the
312
+ * user immediate feedback.
313
+ */
314
+ diag = kgdb_validate_break_address(template.bp_addr);
315
+ if (diag)
316
+ return diag;
317
+
318
+ /*
310319 * Find an empty bp structure to allocate
311320 */
312321 for (bpno = 0, bp = kdb_breakpoints; bpno < KDB_MAXBPT; bpno++, bp++) {
....@@ -412,7 +421,6 @@
412421 * assume that the breakpoint number is desired.
413422 */
414423 if (addr < KDB_MAXBPT) {
415
- bp = &kdb_breakpoints[addr];
416424 lowbp = highbp = addr;
417425 highbp++;
418426 } else {