aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLenny Szubowicz <lszubowi@redhat.com>2013-06-28 16:14:11 -0400
committerTony Luck <tony.luck@intel.com>2013-06-28 18:23:24 -0400
commit0d838347f1325cebfe8b9341a4b4c1f407022231 (patch)
tree50d0fad2c4b4df70f3f276eabe59ad3109938718
parent74fd6c6f84b6d3e57bacb06161451c29949fbe51 (diff)
efivars: If pstore_register fails, free unneeded pstore buffer
This is patch 3/3 of a patch set that cleans up pstore_register failure paths. If efivars fails to register with pstore, there is no point to keeping the 4 KB buffer around. It's only used by the pstore read/write routines. Signed-off-by: Lenny Szubowicz <lszubowi@redhat.com> Reported-by: Naotaka Hamaguchi <n.hamaguchi@jp.fujitsu.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r--drivers/firmware/efi/efi-pstore.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c
index c692bb662178..91864ad200ff 100644
--- a/drivers/firmware/efi/efi-pstore.c
+++ b/drivers/firmware/efi/efi-pstore.c
@@ -235,7 +235,11 @@ static __init int efivars_pstore_init(void)
235 efi_pstore_info.bufsize = 1024; 235 efi_pstore_info.bufsize = 1024;
236 spin_lock_init(&efi_pstore_info.buf_lock); 236 spin_lock_init(&efi_pstore_info.buf_lock);
237 237
238 pstore_register(&efi_pstore_info); 238 if (pstore_register(&efi_pstore_info)) {
239 kfree(efi_pstore_info.buf);
240 efi_pstore_info.buf = NULL;
241 efi_pstore_info.bufsize = 0;
242 }
239 243
240 return 0; 244 return 0;
241} 245}