Skip to content

Commit

Permalink
livepatch: Small shadow variable documentation fixes
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Petr Mladek <pmladek@suse.com>
Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Petr Mladek authored and Jiri Kosina committed Oct 2, 2017
1 parent 5d9da75 commit 19205da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Documentation/livepatch/shadow-vars.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 19205da

Please sign in to comment.