Skip to content

Commit 9bead1b

Browse files
committed
Merge tag 'array-bounds-fixes-5.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux
Pull array bounds warning fix from Gustavo Silva: "Fix a couple of out-of-bounds warnings in the media subsystem. This is part of the ongoing efforts to globally enable -Warray-bounds" * tag 'array-bounds-fixes-5.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux: media: ngene: Fix out-of-bounds bug in ngene_command_config_free_buf()
2 parents 9f42f67 + 8d4abca commit 9bead1b

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

drivers/media/pci/ngene/ngene-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ static int ngene_command_config_free_buf(struct ngene *dev, u8 *config)
385385

386386
com.cmd.hdr.Opcode = CMD_CONFIGURE_FREE_BUFFER;
387387
com.cmd.hdr.Length = 6;
388-
memcpy(&com.cmd.ConfigureBuffers.config, config, 6);
388+
memcpy(&com.cmd.ConfigureFreeBuffers.config, config, 6);
389389
com.in_len = 6;
390390
com.out_len = 0;
391391

drivers/media/pci/ngene/ngene.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,14 @@ enum _BUFFER_CONFIGS {
407407

408408
struct FW_CONFIGURE_FREE_BUFFERS {
409409
struct FW_HEADER hdr;
410-
u8 UVI1_BufferLength;
411-
u8 UVI2_BufferLength;
412-
u8 TVO_BufferLength;
413-
u8 AUD1_BufferLength;
414-
u8 AUD2_BufferLength;
415-
u8 TVA_BufferLength;
410+
struct {
411+
u8 UVI1_BufferLength;
412+
u8 UVI2_BufferLength;
413+
u8 TVO_BufferLength;
414+
u8 AUD1_BufferLength;
415+
u8 AUD2_BufferLength;
416+
u8 TVA_BufferLength;
417+
} __packed config;
416418
} __attribute__ ((__packed__));
417419

418420
struct FW_CONFIGURE_UART {

0 commit comments

Comments
 (0)