Skip to contentSkip to conversation

livepatch: Small shadow variable documentation fixes

PATCH Applied Petr Mladek 3 participants 3 messages Sep 25, 2017 – Oct 2, 2017

Subsystems (2)
lore
Share & tools
lore

Petr Mladek

author maintainer
#0 lore raw

PATCH 1/1 livepatch: Small shadow variable documentation fixes

The description of the basic operations was a bit inconsistent and based on older version of the patchset.

Also the size of the spinlock structure should be allocated instead of the pointer.

---
 Documentation/livepatch/shadow-vars.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/livepatch/shadow-vars.txt +2 -2
index e3ffc4301bfa..89c66634d600 100644
@@ -6,7 +6,7 @@ Shadow variables are a simple way for livepatch modules to associate
 additional "shadow" data with existing data structures.  Shadow data is
 allocated separately from parent data structures, which are left
 unmodified.  The shadow variable API described in this document is used
-to allocate/attach and detach/release shadow variables to their parents.
+to allocate/add and remove/free shadow variables to/from their parents.
 
 The implementation introduces a global, in-kernel hashtable that
 associates pointers to parent objects and a numeric identifier of the
@@ -107,7 +107,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
 	sta = kzalloc(sizeof(*sta) + hw->sta_data_size, gfp);
 
 	/* Attach a corresponding shadow variable, then initialize it */
-	ps_lock = klp_shadow_alloc(sta, PS_LOCK, NULL, sizeof(ps_lock), gfp);
+	ps_lock = klp_shadow_alloc(sta, PS_LOCK, NULL, sizeof(*ps_lock), gfp);
 	if (!ps_lock)
 		goto shadow_fail;
 	spin_lock_init(ps_lock);
Signature · 1 line
1.8.5.6
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 35 lines · Petr Mladek

The description of the basic operations was a bit inconsistent and based on older version of the patchset.

Also the size of the spinlock structure should be allocated instead of the pointer.

---
 Documentation/livepatch/shadow-vars.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/livepatch/shadow-vars.txt +2 -2
index e3ffc4301bfa..89c66634d600 100644
@@ -6,7 +6,7 @@ Shadow variables are a simple way for livepatch modules to associate
 additional "shadow" data with existing data structures.  Shadow data is
 allocated separately from parent data structures, which are left
 unmodified.  The shadow variable API described in this document is used
-to allocate/attach and detach/release shadow variables to their parents.
+to allocate/add and remove/free shadow variables to/from their parents.
 
 The implementation introduces a global, in-kernel hashtable that
 associates pointers to parent objects and a numeric identifier of the
@@ -107,7 +107,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
 	sta = kzalloc(sizeof(*sta) + hw->sta_data_size, gfp);
 
 	/* Attach a corresponding shadow variable, then initialize it */
-	ps_lock = klp_shadow_alloc(sta, PS_LOCK, NULL, sizeof(ps_lock), gfp);
+	ps_lock = klp_shadow_alloc(sta, PS_LOCK, NULL, sizeof(*ps_lock), gfp);
 	if (!ps_lock)
 		goto shadow_fail;
 	spin_lock_init(ps_lock);
Signature · 1 line
1.8.5.6

Thanks, Petr!

-- Joe

Applied
#2 lore raw
In reply to Petr Mladek
Quoted 7 lines · Petr Mladek

The description of the basic operations was a bit inconsistent and based on older version of the patchset.

Also the size of the spinlock structure should be allocated instead of the pointer.

Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs