diff options
| -rw-r--r-- | drivers/firmware/efivars.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 7b1c37497c9a..ef5070d86f88 100644 --- a/drivers/firmware/efivars.c +++ b/drivers/firmware/efivars.c | |||
| @@ -1209,7 +1209,16 @@ static int efi_pstore_write(enum pstore_type_id type, | |||
| 1209 | u64 storage_space, remaining_space, max_variable_size; | 1209 | u64 storage_space, remaining_space, max_variable_size; |
| 1210 | efi_status_t status = EFI_NOT_FOUND; | 1210 | efi_status_t status = EFI_NOT_FOUND; |
| 1211 | 1211 | ||
| 1212 | spin_lock(&efivars->lock); | 1212 | if (pstore_cannot_block_path(reason)) { |
| 1213 | /* | ||
| 1214 | * If the lock is taken by another cpu in non-blocking path, | ||
| 1215 | * this driver returns without entering firmware to avoid | ||
| 1216 | * hanging up. | ||
| 1217 | */ | ||
| 1218 | if (!spin_trylock(&efivars->lock)) | ||
| 1219 | return -EBUSY; | ||
| 1220 | } else | ||
| 1221 | spin_lock(&efivars->lock); | ||
| 1213 | 1222 | ||
| 1214 | /* | 1223 | /* |
| 1215 | * Check if there is a space enough to log. | 1224 | * Check if there is a space enough to log. |
