[PATCH v2] devres: Initialize a uninitialized struct member

From: Zijun Hu
Date: Fri Jun 28 2024 - 09:01:57 EST


From: Zijun Hu <zijuhu@xxxxxxxxxxxxxxxx>

Initialize an uninitialized struct member for driver API
devres_open_group().

Signed-off-by: Zijun Hu <zijuhu@xxxxxxxxxxxxxxxx>
---
V2: Simplify fix by use = instead of memset() and commit message

Previous discussion link:
https://lore.kernel.org/lkml/1718629765-32720-1-git-send-email-quic_zijuhu@xxxxxxxxxxx/

drivers/base/devres.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/base/devres.c b/drivers/base/devres.c
index 3df0025d12aa..3beedeaa0ffc 100644
--- a/drivers/base/devres.c
+++ b/drivers/base/devres.c
@@ -567,6 +567,7 @@ void * devres_open_group(struct device *dev, void *id, gfp_t gfp)
grp->id = grp;
if (id)
grp->id = id;
+ grp->color = 0;

spin_lock_irqsave(&dev->devres_lock, flags);
add_dr(dev, &grp->node[0]);
--
2.7.4