Skip to contentSkip to conversation

docs: livepatch: adopt type-aware kzalloc

PATCH New Manuel Ebner 1 participant 1 message Aug 23

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs: livepatch: adopt type-aware kzalloc

Hi, I would like to help with the introduction of new code, but I can't figure out what do to with 'hw->sta_data_size'. 'gfp' can be dropped, because it's the new default.

Thanks
Manuel

---
 Documentation/livepatch/shadow-vars.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/livepatch/shadow-vars.rst +1 -1
index 7a7098bfb..99856bee8 100644
@@ -127,7 +127,7 @@ allocate a shadow copy of the ps_lock pointer, then initialize it::
 	spinlock_t *ps_lock;
 
 	/* Parent structure is created */
-	sta = kzalloc(sizeof(*sta) + hw->sta_data_size, gfp);
+       sta = kzalloc_obj(*sta);
 
 	/* Attach a corresponding shadow variable, then initialize it */
 	ps_lock = klp_shadow_alloc(sta, PS_LOCK, sizeof(*ps_lock), gfp,
Signature · 1 line
2.54.0