[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MISRA C:2012 D4.11 caution on staging
- To: Jan Beulich <jbeulich@xxxxxxxx>, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
- From: Julien Grall <julien@xxxxxxx>
- Date: Tue, 17 Oct 2023 14:28:16 +0100
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, consulting@xxxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, roger.pau@xxxxxxxxxx, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Tue, 17 Oct 2023 13:28:28 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Hi Jan,
On 17/10/2023 07:11, Jan Beulich wrote:
On 16.10.2023 20:06, Julien Grall wrote:
Instead, it would be best to find a way to help Eclair to detect this is
not an issue and also improve readability. Would the following help Eclair?
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 30c227967345..ab16124eabd6 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -671,6 +671,8 @@ struct domain *domain_create(domid_t domid,
if ( !is_idle_domain(d) )
{
+ ASSERT(config);
+
watchdog_domain_init(d);
init_status |= INIT_watchdog;
Just to mention it: Even if right now it turned out to help, it wouldn't
once release builds are also checked.
Indeed. I thought about it when writing the e-mail yesterday. I have the
feeling that we are not getting many similar report today thanks to the
various ASSERT().
This may mean that the ASSERT() will have to be kept during static
analysis or we deviate/add proper error checking.
Cheers,
--
Julien Grall
|