Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234491
b: refs/heads/master
c: 4defe68
h: refs/heads/master
i:
  234489: 555dc61
  234487: 408dad6
v: v3
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Feb 8, 2011
1 parent 7490844 commit e61f48b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 75b8e98263fdb0bfbdeba60d4db463259f1fe8a2
refs/heads/master: 4defe682d81a4960b6840ee4ed1a36f9db77c7bd
30 changes: 7 additions & 23 deletions trunk/kernel/trace/trace_events_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,33 +795,17 @@ static int __alloc_preds(struct event_filter *filter, int n_preds)
struct filter_pred *pred;
int i;

if (filter->preds) {
if (filter->a_preds < n_preds) {
/*
* We need to reallocate.
* We should have already have zeroed out
* the pred count and called synchronized_sched()
* to make sure no one is using the preds.
*/
if (WARN_ON_ONCE(filter->n_preds)) {
/* We need to reset it now */
filter->n_preds = 0;
synchronize_sched();
}
__free_preds(filter);
}
}
if (filter->preds)
__free_preds(filter);

filter->preds =
kzalloc(sizeof(*filter->preds) * n_preds, GFP_KERNEL);

if (!filter->preds) {
filter->preds =
kzalloc(sizeof(*filter->preds) * n_preds, GFP_KERNEL);
filter->a_preds = n_preds;
}
if (!filter->preds)
return -ENOMEM;

if (WARN_ON(filter->a_preds < n_preds))
return -EINVAL;
filter->a_preds = n_preds;
filter->n_preds = 0;

for (i = 0; i < n_preds; i++) {
pred = &filter->preds[i];
Expand Down

0 comments on commit e61f48b

Please sign in to comment.