Skip to content

Commit 505e201

Browse files
serhiy-katsyuba-intellgirdwood
authored andcommitted
dai-zephyr: zero unused dai_config members
This prevents initializing unused members of struct dai_config with random garbage from the stack. In case some Zephyr DAI driver uses such an uninitialized member, it's better to have a bug with stable reproduction than a random one. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
1 parent 21479d0 commit 505e201

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/audio/dai-zephyr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ __cold int dai_set_config(struct dai *dai, struct ipc_config_dai *common_config,
145145
{
146146
const struct device *dev = dai->dev;
147147
const struct sof_ipc_dai_config *sof_cfg = spec_config;
148-
struct dai_config cfg;
148+
struct dai_config cfg = {0};
149149
const void *cfg_params;
150150
bool is_blob;
151151

0 commit comments

Comments
 (0)