Skip to content

Commit 353bb6a

Browse files
simontrimmerbroonie
authored andcommitted
ASoC: wm_adsp: Compressed stream DSP memory structs should be __packed
The compressed stream code has a bunch of structs that are used to represent DSP memory but have not been marked __packed. This isn't safe, they could get padded on a 64-bit build. Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220309130017.2816-1-simont@opensource.cirrus.com Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 5e02fb5 commit 353bb6a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

sound/soc/codecs/wm_adsp.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ struct wm_adsp_system_config_xm_hdr {
9797
__be32 wdma[8];
9898
__be32 build_job_name[3];
9999
__be32 build_job_number;
100-
};
100+
} __packed;
101101

102102
struct wm_halo_system_config_xm_hdr {
103103
__be32 halo_heartbeat;
104104
__be32 build_job_name[3];
105105
__be32 build_job_number;
106-
};
106+
} __packed;
107107

108108
struct wm_adsp_alg_xm_struct {
109109
__be32 magic;
@@ -114,13 +114,13 @@ struct wm_adsp_alg_xm_struct {
114114
__be32 high_water_mark;
115115
__be32 low_water_mark;
116116
__be64 smoothed_power;
117-
};
117+
} __packed;
118118

119119
struct wm_adsp_host_buf_coeff_v1 {
120120
__be32 host_buf_ptr; /* Host buffer pointer */
121121
__be32 versions; /* Version numbers */
122122
__be32 name[4]; /* The buffer name */
123-
};
123+
} __packed;
124124

125125
struct wm_adsp_buffer {
126126
__be32 buf1_base; /* Base addr of first buffer area */
@@ -141,7 +141,7 @@ struct wm_adsp_buffer {
141141
__be32 min_free; /* min free space since stream start */
142142
__be32 blocks_written[2]; /* total blocks written (64 bit) */
143143
__be32 words_written[2]; /* total words written (64 bit) */
144-
};
144+
} __packed;
145145

146146
struct wm_adsp_compr;
147147

0 commit comments

Comments
 (0)