All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] firmware: vpd: do not leave freed section attributes to the list
@ 2017-05-24  0:07 Dmitry Torokhov
  2017-05-24  0:07 ` [PATCH 2/8] firmware: vpd: use kdtrndup when copying section key Dmitry Torokhov
                   ` (8 more replies)
  0 siblings, 9 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2017-05-24  0:07 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Wei-Ning Huang, Julius Werner, Guenter Roeck, linux-kernel

We should only add section attribute to the list of section attributes
if we successfully created corresponding sysfs attribute.

Fixes: 049a59db34eb ("firmware: Google VPD sysfs driver")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/firmware/google/vpd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/google/vpd.c b/drivers/firmware/google/vpd.c
index 1e7860f02f4f..23a24a6d02c2 100644
--- a/drivers/firmware/google/vpd.c
+++ b/drivers/firmware/google/vpd.c
@@ -136,12 +136,12 @@ static int vpd_section_attrib_add(const u8 *key, s32 key_len,
 	info->value = value;
 
 	INIT_LIST_HEAD(&info->list);
-	list_add_tail(&info->list, &sec->attribs);
 
 	ret = sysfs_create_bin_file(sec->kobj, &info->bin_attr);
 	if (ret)
 		goto free_info_key;
 
+	list_add_tail(&info->list, &sec->attribs);
 	return 0;
 
 free_info_key:
-- 
2.13.0.219.gdb65acc882-goog

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2017-05-25 16:50 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-24  0:07 [PATCH 1/8] firmware: vpd: do not leave freed section attributes to the list Dmitry Torokhov
2017-05-24  0:07 ` [PATCH 2/8] firmware: vpd: use kdtrndup when copying section key Dmitry Torokhov
2017-05-24 17:13   ` Guenter Roeck
2017-05-24  0:07 ` [PATCH 3/8] firmware: vpd: avoid potential use-after-free when destroying section Dmitry Torokhov
2017-05-24 17:15   ` Guenter Roeck
2017-05-24  0:07 ` [PATCH 4/8] firmware: vpd: do not leak kobjects Dmitry Torokhov
2017-05-24 17:16   ` Guenter Roeck
2017-05-24  0:07 ` [PATCH 5/8] firmware: vpd: use kasprintf() when forming name of 'raw' attribute Dmitry Torokhov
2017-05-24 17:18   ` Guenter Roeck
2017-05-24  0:07 ` [PATCH 6/8] firmware: vpd: do not clear statically allocated data Dmitry Torokhov
2017-05-24 17:19   ` Guenter Roeck
2017-05-24  0:07 ` [PATCH 7/8] firmware: vpd: remove platform driver Dmitry Torokhov
2017-05-24 17:22   ` Guenter Roeck
2017-05-25  0:04     ` Julius Werner
2017-05-25  2:38       ` Dmitry Torokhov
2017-05-24  0:07 ` [PATCH 8/8] firmware: vpd: fix confusion between memremap and iounmap Dmitry Torokhov
2017-05-24 17:23   ` Guenter Roeck
2017-05-25 13:41   ` Greg Kroah-Hartman
2017-05-24 17:13 ` [PATCH 1/8] firmware: vpd: do not leave freed section attributes to the list Guenter Roeck
2017-05-25 13:40 ` Greg Kroah-Hartman
2017-05-25 16:35   ` Dmitry Torokhov
2017-05-25 16:50     ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.