| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Licensed Materials - Property of IBM | 3 * Licensed Materials - Property of IBM |
| 4 * | 4 * |
| 5 * trousers - An open source TCG Software Stack | 5 * trousers - An open source TCG Software Stack |
| 6 * | 6 * |
| 7 * (C) Copyright International Business Machines Corp. 2004 | 7 * (C) Copyright International Business Machines Corp. 2004 |
| 8 * | 8 * |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 } | 151 } |
| 152 | 152 |
| 153 MUTEX_UNLOCK(ht->lock); | 153 MUTEX_UNLOCK(ht->lock); |
| 154 } | 154 } |
| 155 | 155 |
| 156 struct host_table_entry * | 156 struct host_table_entry * |
| 157 get_table_entry(TSS_HCONTEXT tspContext) | 157 get_table_entry(TSS_HCONTEXT tspContext) |
| 158 { | 158 { |
| 159 struct host_table_entry *index = NULL; | 159 struct host_table_entry *index = NULL; |
| 160 | 160 |
| 161 /* Avoid shutdown race in wpa_supplicant */ |
| 162 if (ht == NULL) |
| 163 return NULL; |
| 164 |
| 161 MUTEX_LOCK(ht->lock); | 165 MUTEX_LOCK(ht->lock); |
| 162 | 166 |
| 163 for (index = ht->entries; index; index = index->next) { | 167 for (index = ht->entries; index; index = index->next) { |
| 164 if (index->tspContext == tspContext) | 168 if (index->tspContext == tspContext) |
| 165 break; | 169 break; |
| 166 } | 170 } |
| 167 | 171 |
| 168 if (index) | 172 if (index) |
| 169 MUTEX_LOCK(index->lock); | 173 MUTEX_LOCK(index->lock); |
| 170 | 174 |
| 171 MUTEX_UNLOCK(ht->lock); | 175 MUTEX_UNLOCK(ht->lock); |
| 172 | 176 |
| 173 return index; | 177 return index; |
| 174 } | 178 } |
| 175 | 179 |
| 176 void | 180 void |
| 177 put_table_entry(struct host_table_entry *entry) | 181 put_table_entry(struct host_table_entry *entry) |
| 178 { | 182 { |
| 179 if (entry) | 183 if (entry) |
| 180 MUTEX_UNLOCK(entry->lock); | 184 MUTEX_UNLOCK(entry->lock); |
| 181 } | 185 } |
| 182 | |
| OLD | NEW |