diff options
| -rw-r--r-- | kernel/trace/trace_ksym.c | 32 | 
1 files changed, 14 insertions, 18 deletions
| diff --git a/kernel/trace/trace_ksym.c b/kernel/trace/trace_ksym.c index b6710d31bdf0..955600929907 100644 --- a/kernel/trace/trace_ksym.c +++ b/kernel/trace/trace_ksym.c | |||
| @@ -114,24 +114,22 @@ void ksym_hbp_handler(struct hw_breakpoint *hbp, struct pt_regs *regs) | |||
| 114 | * --x : Set Execution Break points (Not available yet) | 114 | * --x : Set Execution Break points (Not available yet) | 
| 115 | * | 115 | * | 
| 116 | */ | 116 | */ | 
| 117 | static int ksym_trace_get_access_type(char *access_str) | 117 | static int ksym_trace_get_access_type(char *str) | 
| 118 | { | 118 | { | 
| 119 | int pos, access = 0; | 119 | int access = 0; | 
| 120 | 120 | ||
| 121 | for (pos = 0; pos < KSYM_TRACER_OP_LEN; pos++) { | 121 | if (str[0] == 'r') | 
| 122 | switch (access_str[pos]) { | 122 | access += 4; | 
| 123 | case 'r': | 123 | else if (str[0] != '-') | 
| 124 | access += (pos == 0) ? 4 : -1; | 124 | return -EINVAL; | 
| 125 | break; | 125 | |
| 126 | case 'w': | 126 | if (str[1] == 'w') | 
| 127 | access += (pos == 1) ? 2 : -1; | 127 | access += 2; | 
| 128 | break; | 128 | else if (str[1] != '-') | 
| 129 | case '-': | 129 | return -EINVAL; | 
| 130 | break; | 130 | |
| 131 | default: | 131 | if (str[2] != '-') | 
| 132 | return -EINVAL; | 132 | return -EINVAL; | 
| 133 | } | ||
| 134 | } | ||
| 135 | 133 | ||
| 136 | switch (access) { | 134 | switch (access) { | 
| 137 | case 6: | 135 | case 6: | 
| @@ -140,8 +138,6 @@ static int ksym_trace_get_access_type(char *access_str) | |||
| 140 | case 2: | 138 | case 2: | 
| 141 | access = HW_BREAKPOINT_WRITE; | 139 | access = HW_BREAKPOINT_WRITE; | 
| 142 | break; | 140 | break; | 
| 143 | case 0: | ||
| 144 | access = 0; | ||
| 145 | } | 141 | } | 
| 146 | 142 | ||
| 147 | return access; | 143 | return access; | 
