Unverified Commit 66ca7b64 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!6909 i2c: mlxbf: prevent stack overflow in mlxbf_i2c_smbus_start_transaction()

parents 84913d9f 203aebd3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -744,6 +744,9 @@ mlxbf_i2c_smbus_start_transaction(struct mlxbf_i2c_priv *priv,
		if (flags & MLXBF_I2C_F_WRITE) {
			write_en = 1;
			write_len += operation->length;
			if (data_idx + operation->length >
					MLXBF_I2C_MASTER_DATA_DESC_SIZE)
				return -ENOBUFS;
			memcpy(data_desc + data_idx,
			       operation->buffer, operation->length);
			data_idx += operation->length;