tsk, true);
thread->ptrace_bps[i] = NULL;
- if (!bp) { /* incorrect bp, or we have a bug in bp API */
- rc = -EINVAL;
- break;
- }
+ /* Incorrect bp, or we have a bug in bp API */
if (IS_ERR(bp)) {
rc = PTR_ERR(bp);
bp = NULL;
tsk,
bp->attr.disabled);
}
-
- if (!bp)
- return -EIO;
/*
* CHECKME: the previous code returned -EIO if the addr wasn't a
* valid task virtual addr. The new one will return -EINVAL in this
*pevent = bp;
- if (IS_ERR(bp) || !bp) {
+ if (IS_ERR(bp)) {
err = PTR_ERR(bp);
goto fail;
}
fail:
for_each_possible_cpu(cpu) {
pevent = per_cpu_ptr(cpu_events, cpu);
- if (IS_ERR(*pevent) || !*pevent)
+ if (IS_ERR(*pevent))
break;
unregister_hw_breakpoint(*pevent);
}
entry->ksym_hbp = register_wide_hw_breakpoint(entry->ksym_addr,
entry->len, entry->type,
ksym_hbp_handler, true);
+
if (IS_ERR(entry->ksym_hbp)) {
- entry->ksym_hbp = NULL;
ret = PTR_ERR(entry->ksym_hbp);
- }
-
- if (!entry->ksym_hbp) {
printk(KERN_INFO "ksym_tracer request failed. Try again"
" later!!\n");
goto err;
if (changed) {
unregister_wide_hw_breakpoint(entry->ksym_hbp);
entry->type = op;
+ ret = 0;
if (op > 0) {
entry->ksym_hbp =
register_wide_hw_breakpoint(entry->ksym_addr,
entry->len, entry->type,
ksym_hbp_handler, true);
if (IS_ERR(entry->ksym_hbp))
- entry->ksym_hbp = NULL;
-
- /* modified without problem */
- if (entry->ksym_hbp) {
- ret = 0;
+ ret = PTR_ERR(entry->ksym_hbp);
+ else
goto out;
- }
- } else {
- ret = 0;
}
/* Error or "symbol:---" case: drop it */
ksym_filter_entry_count--;
if (IS_ERR(sample_hbp)) {
ret = PTR_ERR(sample_hbp);
goto fail;
- } else if (!sample_hbp) {
- ret = -EINVAL;
- goto fail;
}
printk(KERN_INFO "HW Breakpoint for %s write installed\n", ksym_name);