From f870d11f676f05e8e968e1a7f7d92269a73ef99a Mon Sep 17 00:00:00 2001 From: Mikael Olsson Date: Tue, 2 Apr 2024 17:20:47 +0200 Subject: Fix Rpmsg constructor not initializing members The constructor for the Rpmsg class does not zero-initialize its member variables. This causes issues with the remoteproc library because it thinks function pointers in the variables are set to valid functions when they are actually just uninitialized values and using these function pointer causes crashes and unexpected behavior. To resolve this, the Rpmsg class constructor has been changed to zero-initialize all its member variables. Change-Id: Ic34fd52bc39ed3018e5f67474949f10adc8cb7a8 Signed-off-by: Mikael Olsson --- applications/message_handler_openamp/remoteproc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/message_handler_openamp/remoteproc.cpp b/applications/message_handler_openamp/remoteproc.cpp index ed6f7d0..599452b 100644 --- a/applications/message_handler_openamp/remoteproc.cpp +++ b/applications/message_handler_openamp/remoteproc.cpp @@ -160,7 +160,7 @@ int RProc::notify(remoteproc *rproc, uint32_t id) { * Rpmsg *****************************************************************************/ -Rpmsg::Rpmsg(RProc &rproc, const char *const name) { +Rpmsg::Rpmsg(RProc &rproc, const char *const name) : rvdev({}), rdev(), endpoint({}) { struct virtio_device *vdev = rproc.getVDev(); if (vdev->vrings_num != ResourceTable::NUM_VRINGS) { -- cgit v1.2.1