drivers/net/can/pch_can.c ae64438be192 ("can: dev: fix skb drop check") 1dd1b521be85 ("can: remove obsolete PCH CAN driver") https://lore.kernel.org/all/20221110102509.1f7d63cc@canb.auug.org.au/
Showing the changes to kernel/trace (4 of 385 files). Show all
Unified · Split
| @@ -141,6 +141,8 @@ static int fprobe_init_rethook(struct fprobe *fp, int num) · 140 unmodified lines | ||
| 141 | 141 | return -E2BIG; |
| 142 | 142 | |
| 143 | 143 | fp->rethook = rethook_alloc((void *)fp, fprobe_exit_handler); |
| 144 | + if (!fp->rethook) | |
| 145 | + return -ENOMEM; | |
| 144 | 146 | for (i = 0; i < size; i++) { |
| 145 | 147 | struct fprobe_rethook_node *node; |
| 146 | 148 | |
| @@ -301,7 +303,8 @@ int unregister_fprobe(struct fprobe *fp) · 154 unmodified lines | ||
| 301 | 303 | { |
| 302 | 304 | int ret; |
| 303 | 305 | |
| 304 | − if (!fp || fp->ops.func != fprobe_handler) | |
| 306 | + if (!fp || (fp->ops.saved_func != fprobe_handler && | |
| 307 | + fp->ops.saved_func != fprobe_kprobe_handler)) | |
| 305 | 308 | return -EINVAL; |
| 306 | 309 | |
| 307 | 310 | /* |
| @@ -3028,18 +3028,8 @@ int ftrace_shutdown(struct ftrace_ops *ops, int command) · 3027 unmodified lines | ||
| 3028 | 3028 | command |= FTRACE_UPDATE_TRACE_FUNC; |
| 3029 | 3029 | } |
| 3030 | 3030 | |
| 3031 | − if (!command || !ftrace_enabled) { | |
| 3032 | − /* | |
| 3033 | − * If these are dynamic or per_cpu ops, they still | |
| 3034 | − * need their data freed. Since, function tracing is | |
| 3035 | − * not currently active, we can just free them | |
| 3036 | − * without synchronizing all CPUs. | |
| 3037 | − */ | |
| 3038 | − if (ops->flags & FTRACE_OPS_FL_DYNAMIC) | |
| 3039 | − goto free_ops; | |
| 3040 | − | |
| 3041 | − return 0; | |
| 3042 | − } | |
| 3031 | + if (!command || !ftrace_enabled) | |
| 3032 | + goto out; | |
| 3043 | 3033 | |
| 3044 | 3034 | /* |
| 3045 | 3035 | * If the ops uses a trampoline, then it needs to be |
| @@ -3076,6 +3066,7 @@ int ftrace_shutdown(struct ftrace_ops *ops, int command) · 30 unmodified lines | ||
| 3076 | 3066 | removed_ops = NULL; |
| 3077 | 3067 | ops->flags &= ~FTRACE_OPS_FL_REMOVING; |
| 3078 | 3068 | |
| 3069 | +out: | |
| 3079 | 3070 | /* |
| 3080 | 3071 | * Dynamic ops may be freed, we must make sure that all |
| 3081 | 3072 | * callers are done before leaving this function. |
| @@ -3103,7 +3094,6 @@ int ftrace_shutdown(struct ftrace_ops *ops, int command) · 21 unmodified lines | ||
| 3103 | 3094 | if (IS_ENABLED(CONFIG_PREEMPTION)) |
| 3104 | 3095 | synchronize_rcu_tasks(); |
| 3105 | 3096 | |
| 3106 | − free_ops: | |
| 3107 | 3097 | ftrace_trampoline_free(ops); |
| 3108 | 3098 | } |
| 3109 | 3099 | |
| @@ -100,20 +100,20 @@ static int __init test_gen_kprobe_cmd(void) · 99 unmodified lines | ||
| 100 | 100 | KPROBE_GEN_TEST_FUNC, |
| 101 | 101 | KPROBE_GEN_TEST_ARG0, KPROBE_GEN_TEST_ARG1); |
| 102 | 102 | if (ret) |
| 103 | − goto free; | |
| 103 | + goto out; | |
| 104 | 104 | |
| 105 | 105 | /* Use kprobe_event_add_fields to add the rest of the fields */ |
| 106 | 106 | |
| 107 | 107 | ret = kprobe_event_add_fields(&cmd, KPROBE_GEN_TEST_ARG2, KPROBE_GEN_TEST_ARG3); |
| 108 | 108 | if (ret) |
| 109 | − goto free; | |
| 109 | + goto out; | |
| 110 | 110 | |
| 111 | 111 | /* |
| 112 | 112 | * This actually creates the event. |
| 113 | 113 | */ |
| 114 | 114 | ret = kprobe_event_gen_cmd_end(&cmd); |
| 115 | 115 | if (ret) |
| 116 | − goto free; | |
| 116 | + goto out; | |
| 117 | 117 | |
| 118 | 118 | /* |
| 119 | 119 | * Now get the gen_kprobe_test event file. We need to prevent |
| @@ -136,13 +136,11 @@ static int __init test_gen_kprobe_cmd(void) · 16 unmodified lines | ||
| 136 | 136 | goto delete; |
| 137 | 137 | } |
| 138 | 138 | out: |
| 139 | + kfree(buf); | |
| 139 | 140 | return ret; |
| 140 | 141 | delete: |
| 141 | 142 | /* We got an error after creating the event, delete it */ |
| 142 | 143 | ret = kprobe_event_delete("gen_kprobe_test"); |
| 143 | − free: | |
| 144 | − kfree(buf); | |
| 145 | − | |
| 146 | 144 | goto out; |
| 147 | 145 | } |
| 148 | 146 | |
| @@ -170,14 +168,14 @@ static int __init test_gen_kretprobe_cmd(void) · 21 unmodified lines | ||
| 170 | 168 | KPROBE_GEN_TEST_FUNC, |
| 171 | 169 | "$retval"); |
| 172 | 170 | if (ret) |
| 173 | − goto free; | |
| 171 | + goto out; | |
| 174 | 172 | |
| 175 | 173 | /* |
| 176 | 174 | * This actually creates the event. |
| 177 | 175 | */ |
| 178 | 176 | ret = kretprobe_event_gen_cmd_end(&cmd); |
| 179 | 177 | if (ret) |
| 180 | − goto free; | |
| 178 | + goto out; | |
| 181 | 179 | |
| 182 | 180 | /* |
| 183 | 181 | * Now get the gen_kretprobe_test event file. We need to |
| @@ -201,13 +199,11 @@ static int __init test_gen_kretprobe_cmd(void) · 17 unmodified lines | ||
| 201 | 199 | goto delete; |
| 202 | 200 | } |
| 203 | 201 | out: |
| 202 | + kfree(buf); | |
| 204 | 203 | return ret; |
| 205 | 204 | delete: |
| 206 | 205 | /* We got an error after creating the event, delete it */ |
| 207 | 206 | ret = kprobe_event_delete("gen_kretprobe_test"); |
| 208 | − free: | |
| 209 | − kfree(buf); | |
| 210 | − | |
| 211 | 207 | goto out; |
| 212 | 208 | } |
| 213 | 209 | |
| @@ -937,6 +937,9 @@ void ring_buffer_wake_waiters(struct trace_buffer *buffer, int cpu) · 936 unmodified lines | ||
| 937 | 937 | struct ring_buffer_per_cpu *cpu_buffer; |
| 938 | 938 | struct rb_irq_work *rbwork; |
| 939 | 939 | |
| 940 | + if (!buffer) | |
| 941 | + return; | |
| 942 | + | |
| 940 | 943 | if (cpu == RING_BUFFER_ALL_CPUS) { |
| 941 | 944 | |
| 942 | 945 | /* Wake up individual ones too. One level recursion */ |
| @@ -945,7 +948,15 @@ void ring_buffer_wake_waiters(struct trace_buffer *buffer, int cpu) · 2 unmodified lines | ||
| 945 | 948 | |
| 946 | 949 | rbwork = &buffer->irq_work; |
| 947 | 950 | } else { |
| 951 | + if (WARN_ON_ONCE(!buffer->buffers)) | |
| 952 | + return; | |
| 953 | + if (WARN_ON_ONCE(cpu >= nr_cpu_ids)) | |
| 954 | + return; | |
| 955 | + | |
| 948 | 956 | cpu_buffer = buffer->buffers[cpu]; |
| 957 | + /* The CPU buffer may not have been initialized yet */ | |
| 958 | + if (!cpu_buffer) | |
| 959 | + return; | |
| 949 | 960 | rbwork = &cpu_buffer->irq_work; |
| 950 | 961 | } |
| 951 | 962 | |