Skip to content

Commit 28fc73b

Browse files
committed
[SQUASHME] ASoC: SOF: ops: fix uninitialized use warning
For some architectures/compilers, 0-day reports errors sound/soc/sof/ops.c: In function 'snd_sof_pci_update_bits_unlocked': sound/soc/sof/ops.c:26:6: warning: 'ret' is used uninitialized in this function [-Wuninitialized] u32 ret; ^~~ Fix by forcing value to ~0 (as done in pci_read_config_dword) Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
1 parent 0fee76c commit 28fc73b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/sof/ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ int snd_sof_pci_update_bits_unlocked(struct snd_sof_dev *sdev, u32 offset,
2323
{
2424
bool change;
2525
unsigned int old, new;
26-
u32 ret;
26+
u32 ret = ~0; /* explicit init to remove uninitialized use warnings */
2727

2828
pci_read_config_dword(sdev->pci, offset, &ret);
2929
dev_dbg(sdev->dev, "Debug PCIR: %8.8x at %8.8x\n",

0 commit comments

Comments
 (0)