]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: pressure: mprls0025pa: fix spi_transfer struct initialisation
authorPetre Rodan <petre.rodan@subdimension.ro>
Wed, 14 Jan 2026 16:55:30 +0000 (18:55 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Fri, 16 Jan 2026 17:40:40 +0000 (17:40 +0000)
Make sure that the spi_transfer struct is zeroed out before use.

Fixes: a0858f0cd28e ("iio: pressure: mprls0025pa add SPI driver")
Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/pressure/mprls0025pa_spi.c

index d04102f8a4a03567f14839eb8c505373f7c25071..e6bb75de341191079dc3b8ae4299173c91cb7307 100644 (file)
@@ -40,7 +40,7 @@ static int mpr_spi_xfer(struct mpr_data *data, const u8 cmd, const u8 pkt_len)
 {
        struct spi_device *spi = to_spi_device(data->dev);
        struct mpr_spi_buf *buf = spi_get_drvdata(spi);
-       struct spi_transfer xfer;
+       struct spi_transfer xfer = { };
 
        if (pkt_len > MPR_MEASUREMENT_RD_SIZE)
                return -EOVERFLOW;