| .. | .. |
|---|
| 208 | 208 | return ERR_PTR(-ESRCH); |
|---|
| 209 | 209 | |
|---|
| 210 | 210 | mm = priv->mm; |
|---|
| 211 | | - if (!mm || !mmget_not_zero(mm)) |
|---|
| 211 | + if (!mm || !mmget_not_zero(mm)) { |
|---|
| 212 | + put_task_struct(priv->task); |
|---|
| 213 | + priv->task = NULL; |
|---|
| 212 | 214 | return NULL; |
|---|
| 215 | + } |
|---|
| 213 | 216 | |
|---|
| 214 | 217 | if (mmap_read_lock_killable(mm)) { |
|---|
| 215 | 218 | mmput(mm); |
|---|
| 219 | + put_task_struct(priv->task); |
|---|
| 220 | + priv->task = NULL; |
|---|
| 216 | 221 | return ERR_PTR(-EINTR); |
|---|
| 217 | 222 | } |
|---|
| 218 | 223 | |
|---|
| .. | .. |
|---|
| 221 | 226 | if (n-- == 0) |
|---|
| 222 | 227 | return p; |
|---|
| 223 | 228 | |
|---|
| 224 | | - mmap_read_unlock(mm); |
|---|
| 225 | | - mmput(mm); |
|---|
| 226 | 229 | return NULL; |
|---|
| 227 | 230 | } |
|---|
| 228 | 231 | |
|---|
| 229 | | -static void m_stop(struct seq_file *m, void *_vml) |
|---|
| 232 | +static void m_stop(struct seq_file *m, void *v) |
|---|
| 230 | 233 | { |
|---|
| 231 | 234 | struct proc_maps_private *priv = m->private; |
|---|
| 235 | + struct mm_struct *mm = priv->mm; |
|---|
| 232 | 236 | |
|---|
| 233 | | - if (!IS_ERR_OR_NULL(_vml)) { |
|---|
| 234 | | - mmap_read_unlock(priv->mm); |
|---|
| 235 | | - mmput(priv->mm); |
|---|
| 236 | | - } |
|---|
| 237 | | - if (priv->task) { |
|---|
| 238 | | - put_task_struct(priv->task); |
|---|
| 239 | | - priv->task = NULL; |
|---|
| 240 | | - } |
|---|
| 237 | + if (!priv->task) |
|---|
| 238 | + return; |
|---|
| 239 | + |
|---|
| 240 | + mmap_read_unlock(mm); |
|---|
| 241 | + mmput(mm); |
|---|
| 242 | + put_task_struct(priv->task); |
|---|
| 243 | + priv->task = NULL; |
|---|
| 241 | 244 | } |
|---|
| 242 | 245 | |
|---|
| 243 | 246 | static void *m_next(struct seq_file *m, void *_p, loff_t *pos) |
|---|