Commit 5f596380 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'iio-fixes-for-6.16a' of...

Merge tag 'iio-fixes-for-6.16a' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-linus

Jonathan writes:

iio: 1st set of fixes for the 6.16 cycle

The usual mixed back of the recent and ancient issues that have surfaced
so far this cycle.

iio-core
- Fix a possible out of bounds write on writing string terminator.
iio-backend:
- Fix a possible out of bounds write on writing string terminator.

adi,ad3530r
- Fix wrong masking for channels 4-7 in powerdown mode as they are in a
  second register and mask assumed all in one larger register.
adi,ad7380
- Fix parsing of adi,gain-milli property by reading it as u16 as specified
  in the binding.
adi,ad7606
- Tweak dt-binding to allow both interrupts and backend to be wired up
  resolving some dt_schema warnings.
- Mask value before returning it in register read as for parallel busses
  both the value and (unwanted) address are read back.
adi,ad7949
- Use spi_is_bpw_supported() to correctly handle bits_per_word_mask == 0
  which means default value of 8.
invensense,mpu3050
- Fix wrong number of interrupts in the binding as minItems should have
  been maxItems.
maxim,max1363
- Two related fixes for a long running mismatch between array indexes
  that now results in warnings after the core gained a sanity check.
  Resulted in unnecessary channels being sampled.
nxp,fxls8962
- Fix a use after free in fxls8962af_fifo_flush() if it races with buffer
  mode tear down.
st,sensors
- Stop using indio_dev->dev before it was initialized as the parent device
  should be used anyway for error messages and similar.
st,stm32-adc
- Fix a race when installing chained IRQ handler.
x-powers,axp20x_adc
- Add missing sentinel in ADC channel map (avoid out of bounds read).

* tag 'iio-fixes-for-6.16a' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
  iio: dac: ad3530r: Fix incorrect masking for channels 4-7 in powerdown mode
  iio: adc: ad7380: fix adi,gain-milli property parsing
  iio: adc: ad7949: use spi_is_bpw_supported()
  iio: accel: fxls8962af: Fix use after free in fxls8962af_fifo_flush
  iio: adc: axp20x_adc: Add missing sentinel to AXP717 ADC channel maps
  dt-bindings: iio: gyro: invensense,mpu3050: change irq maxItems
  iio: common: st_sensors: Fix use of uninitialize device structs
  iio: adc: adi-axi-adc: fix ad7606_bus_reg_read()
  dt-bindings: iio: adc: adi,ad7606: fix dt_schema validation warning
  iio: adc: max1363: Reorder mode_list[] entries
  iio: adc: max1363: Fix MAX1363_4X_CHANS/MAX1363_8X_CHANS[]
  iio: adc: stm32-adc: Fix race in installing chained IRQ handler
  iio: fix potential out-of-bound write
  iio: backend: fix out-of-bound write
parents 9fe58ecd 1131e705
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -223,12 +223,6 @@ allOf:
      - required:
          - pwms

  - oneOf:
      - required:
          - interrupts
      - required:
          - io-backends

  - if:
      properties:
        compatible:
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ properties:
  vlogic-supply: true

  interrupts:
    minItems: 1
    maxItems: 1
    description:
      Interrupt mapping for the trigger interrupt from the internal oscillator.

+2 −0
Original line number Diff line number Diff line
@@ -877,6 +877,8 @@ static int fxls8962af_buffer_predisable(struct iio_dev *indio_dev)
	if (ret)
		return ret;

	synchronize_irq(data->irq);

	ret = __fxls8962af_fifo_set_mode(data, false);

	if (data->enable_event)
+5 −5
Original line number Diff line number Diff line
@@ -1353,6 +1353,7 @@ static int apply_acpi_orientation(struct iio_dev *indio_dev)
	union acpi_object *ont;
	union acpi_object *elements;
	acpi_status status;
	struct device *parent = indio_dev->dev.parent;
	int ret = -EINVAL;
	unsigned int val;
	int i, j;
@@ -1371,7 +1372,7 @@ static int apply_acpi_orientation(struct iio_dev *indio_dev)
	};


	adev = ACPI_COMPANION(indio_dev->dev.parent);
	adev = ACPI_COMPANION(parent);
	if (!adev)
		return -ENXIO;

@@ -1380,8 +1381,7 @@ static int apply_acpi_orientation(struct iio_dev *indio_dev)
	if (status == AE_NOT_FOUND) {
		return -ENXIO;
	} else if (ACPI_FAILURE(status)) {
		dev_warn(&indio_dev->dev, "failed to execute _ONT: %d\n",
			 status);
		dev_warn(parent, "failed to execute _ONT: %d\n", status);
		return status;
	}

@@ -1457,12 +1457,12 @@ static int apply_acpi_orientation(struct iio_dev *indio_dev)
	}

	ret = 0;
	dev_info(&indio_dev->dev, "computed mount matrix from ACPI\n");
	dev_info(parent, "computed mount matrix from ACPI\n");

out:
	kfree(buffer.pointer);
	if (ret)
		dev_dbg(&indio_dev->dev,
		dev_dbg(parent,
			"failed to apply ACPI orientation data: %d\n", ret);

	return ret;
+3 −2
Original line number Diff line number Diff line
@@ -1953,8 +1953,9 @@ static int ad7380_probe(struct spi_device *spi)

	if (st->chip_info->has_hardware_gain) {
		device_for_each_child_node_scoped(dev, node) {
			unsigned int channel, gain;
			unsigned int channel;
			int gain_idx;
			u16 gain;

			ret = fwnode_property_read_u32(node, "reg", &channel);
			if (ret)
@@ -1966,7 +1967,7 @@ static int ad7380_probe(struct spi_device *spi)
						     "Invalid channel number %i\n",
						     channel);

			ret = fwnode_property_read_u32(node, "adi,gain-milli",
			ret = fwnode_property_read_u16(node, "adi,gain-milli",
						       &gain);
			if (ret && ret != -EINVAL)
				return dev_err_probe(dev, ret,
Loading