Skip to content

Commit ec2253b

Browse files
committed
iio: adc: rockchip: correct alignment of timestamp
I assume this device is only used on architectures where a 8 byte integer type is always 8 byte aligned. However, I would prefer IIO drivers to never make that assumption as the code gets copied into new drivers which are not so tightly couple to one driver and those can run on architectures that align these types to only 4 bytes in which case this structure may be 4 byte to small leading to a buffer overrun. Reviewed-by: Andy Shevchenko <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 27e6ddf commit ec2253b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/adc/rockchip_saradc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ static irqreturn_t rockchip_saradc_trigger_handler(int irq, void *p)
363363
*/
364364
struct {
365365
u16 values[SARADC_MAX_CHANNELS];
366-
int64_t timestamp;
366+
aligned_s64 timestamp;
367367
} data;
368368
int ret;
369369
int i, j = 0;

0 commit comments

Comments
 (0)