mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
iio: pressure: bmp280: use = { } instead of memset()
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.
Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20250611-iio-zero-init-stack-with-instead-of-memset-v1-23-ebb2d0a24302@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
174818e102
commit
9e664cddd1
|
|
@ -1234,12 +1234,9 @@ static irqreturn_t bme280_trigger_handler(int irq, void *p)
|
|||
s32 comp_temp;
|
||||
u32 comp_humidity;
|
||||
aligned_s64 timestamp;
|
||||
} buffer;
|
||||
} buffer = { }; /* Don't leak uninitialized stack to userspace. */
|
||||
int ret;
|
||||
|
||||
/* Don't leak uninitialized stack to userspace. */
|
||||
memset(&buffer, 0, sizeof(buffer));
|
||||
|
||||
guard(mutex)(&data->lock);
|
||||
|
||||
/* Burst read data registers */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user