[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240823-fix_have_async-v2-1-ed1039527365@quicinc.com>
Date: Fri, 23 Aug 2024 20:00:14 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: Zijun Hu <zijun_hu@...oud.com>, linux-kernel@...r.kernel.org,
Zijun Hu <quic_zijuhu@...cinc.com>
Subject: [PATCH v2] driver core: Explicitly initialize struct member
@data.have_async in __device_attach()
From: Zijun Hu <quic_zijuhu@...cinc.com>
__device_attach() relies on compiler to implicitly initialize struct
member @data.have_async to avoid the member is used before initialization
but readers may not understand that, solved by explicitly initializing
@data.have_async as well as existing @data.want_async.
Signed-off-by: Zijun Hu <quic_zijuhu@...cinc.com>
---
Changes in v2:
- Remove both fix and stable tag
- Correct both title and commit messages
- Link to v1: https://lore.kernel.org/r/20240823-fix_have_async-v1-1-43a354b6614b@quicinc.com
---
drivers/base/dd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 9b745ba54de1..b0c44b0846aa 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -1021,6 +1021,7 @@ static int __device_attach(struct device *dev, bool allow_async)
.dev = dev,
.check_async = allow_async,
.want_async = false,
+ .have_async = false,
};
if (dev->parent)
---
base-commit: 87ee9981d1f86ee9b1623a46c7f9e4ac24461fe4
change-id: 20240823-fix_have_async-3a135618d91b
Best regards,
--
Zijun Hu <quic_zijuhu@...cinc.com>
Powered by blists - more mailing lists