Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: dac: mcp47feb02: Fix mutex used before initialization

The mcp47feb02_parse_fw() function uses data->lock, but the mutex was
initialized after this function in probe path.

Since mcp47feb02_parse_fw() is only called from probe(), remove the lock.

Fixes: bf394cc80369 ("iio: dac: adding support for Microchip MCP47FEB02")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Felix Gu and committed by
Jonathan Cameron
b403981d 57b207e3

-2
-2
drivers/iio/dac/mcp47feb02.c
··· 955 955 u32 num_channels; 956 956 u8 chan_idx = 0; 957 957 958 - guard(mutex)(&data->lock); 959 - 960 958 num_channels = device_get_child_node_count(dev); 961 959 if (num_channels > chip_features->phys_channels) 962 960 return dev_err_probe(dev, -EINVAL, "More channels than the chip supports\n");