Commit 9bead1b5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'array-bounds-fixes-5.14-rc3' of...

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()
parents 9f42f674 8d4abca9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -385,7 +385,7 @@ static int ngene_command_config_free_buf(struct ngene *dev, u8 *config)

	com.cmd.hdr.Opcode = CMD_CONFIGURE_FREE_BUFFER;
	com.cmd.hdr.Length = 6;
	memcpy(&com.cmd.ConfigureBuffers.config, config, 6);
	memcpy(&com.cmd.ConfigureFreeBuffers.config, config, 6);
	com.in_len = 6;
	com.out_len = 0;

+8 −6
Original line number Diff line number Diff line
@@ -407,12 +407,14 @@ enum _BUFFER_CONFIGS {

struct FW_CONFIGURE_FREE_BUFFERS {
	struct FW_HEADER hdr;
	struct {
		u8   UVI1_BufferLength;
		u8   UVI2_BufferLength;
		u8   TVO_BufferLength;
		u8   AUD1_BufferLength;
		u8   AUD2_BufferLength;
		u8   TVA_BufferLength;
	} __packed config;
} __attribute__ ((__packed__));

struct FW_CONFIGURE_UART {