diff options
Diffstat (limited to 'net/core/scm.c')
-rw-r--r-- | net/core/scm.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/net/core/scm.c b/net/core/scm.c index 10f5c65f6a4..b12303dd39d 100644 --- a/net/core/scm.c +++ b/net/core/scm.c | |||
@@ -106,9 +106,25 @@ void __scm_destroy(struct scm_cookie *scm) | |||
106 | 106 | ||
107 | if (fpl) { | 107 | if (fpl) { |
108 | scm->fp = NULL; | 108 | scm->fp = NULL; |
109 | for (i=fpl->count-1; i>=0; i--) | 109 | if (current->scm_work_list) { |
110 | fput(fpl->fp[i]); | 110 | list_add_tail(&fpl->list, current->scm_work_list); |
111 | kfree(fpl); | 111 | } else { |
112 | LIST_HEAD(work_list); | ||
113 | |||
114 | current->scm_work_list = &work_list; | ||
115 | |||
116 | list_add(&fpl->list, &work_list); | ||
117 | while (!list_empty(&work_list)) { | ||
118 | fpl = list_first_entry(&work_list, struct scm_fp_list, list); | ||
119 | |||
120 | list_del(&fpl->list); | ||
121 | for (i=fpl->count-1; i>=0; i--) | ||
122 | fput(fpl->fp[i]); | ||
123 | kfree(fpl); | ||
124 | } | ||
125 | |||
126 | current->scm_work_list = NULL; | ||
127 | } | ||
112 | } | 128 | } |
113 | } | 129 | } |
114 | 130 | ||