Commit be61af33 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull staging driver fixes from Greg KH:
 "Here are some small staging driver fixes for reported problems. They
  include:

   - wfx header file cleanup patch reverted as it could cause problems

   - comedi driver endian fixes

   - buffer overflow problems for staging wifi drivers

   - build dependency issue for rtl8192e driver

  All have been in linux-next for a while with no reported problems"

* tag 'staging-5.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (23 commits)
  Revert "staging: wfx: remove unused included header files"
  staging: rtl8188eu: prevent ->ssid overflow in rtw_wx_set_scan()
  staging: rtl8188eu: fix potential memory corruption in rtw_check_beacon_data()
  staging: rtl8192u: fix ->ssid overflow in r8192_wx_set_scan()
  staging: comedi: pcl726: Use 16-bit 0 for interrupt data
  staging: comedi: ni_65xx: Use 16-bit 0 for interrupt data
  staging: comedi: ni_6527: Use 16-bit 0 for interrupt data
  staging: comedi: comedi_parport: Use 16-bit 0 for interrupt data
  staging: comedi: amplc_pc236_common: Use 16-bit 0 for interrupt data
  staging: comedi: pcl818: Fix endian problem for AI command data
  staging: comedi: pcl711: Fix endian problem for AI command data
  staging: comedi: me4000: Fix endian problem for AI command data
  staging: comedi: dmm32at: Fix endian problem for AI command data
  staging: comedi: das800: Fix endian problem for AI command data
  staging: comedi: das6402: Fix endian problem for AI command data
  staging: comedi: adv_pci1710: Fix endian problem for AI command data
  staging: comedi: addi_apci_1500: Fix endian problem for command sample
  staging: comedi: addi_apci_1032: Fix endian problem for COS sample
  staging: ks7010: prevent buffer overflow in ks_wlan_set_scan()
  staging: rtl8712: Fix possible buffer overflow in r8712_sitesurvey_cmd
  ...
parents cc14086f 16d7586d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -260,6 +260,7 @@ static irqreturn_t apci1032_interrupt(int irq, void *d)
	struct apci1032_private *devpriv = dev->private;
	struct comedi_subdevice *s = dev->read_subdev;
	unsigned int ctrl;
	unsigned short val;

	/* check interrupt is from this device */
	if ((inl(devpriv->amcc_iobase + AMCC_OP_REG_INTCSR) &
@@ -275,7 +276,8 @@ static irqreturn_t apci1032_interrupt(int irq, void *d)
	outl(ctrl & ~APCI1032_CTRL_INT_ENA, dev->iobase + APCI1032_CTRL_REG);

	s->state = inl(dev->iobase + APCI1032_STATUS_REG) & 0xffff;
	comedi_buf_write_samples(s, &s->state, 1);
	val = s->state;
	comedi_buf_write_samples(s, &val, 1);
	comedi_handle_events(dev, s);

	/* enable the interrupt */
+9 −9
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ static irqreturn_t apci1500_interrupt(int irq, void *d)
	struct comedi_device *dev = d;
	struct apci1500_private *devpriv = dev->private;
	struct comedi_subdevice *s = dev->read_subdev;
	unsigned int status = 0;
	unsigned short status = 0;
	unsigned int val;

	val = inl(devpriv->amcc + AMCC_OP_REG_INTCSR);
@@ -238,14 +238,14 @@ static irqreturn_t apci1500_interrupt(int irq, void *d)
	 *
	 *    Mask     Meaning
	 * ----------  ------------------------------------------
	 * 0x00000001  Event 1 has occurred
	 * 0x00000010  Event 2 has occurred
	 * 0x00000100  Counter/timer 1 has run down (not implemented)
	 * 0x00001000  Counter/timer 2 has run down (not implemented)
	 * 0x00010000  Counter 3 has run down (not implemented)
	 * 0x00100000  Watchdog has run down (not implemented)
	 * 0x01000000  Voltage error
	 * 0x10000000  Short-circuit error
	 * 0b00000001  Event 1 has occurred
	 * 0b00000010  Event 2 has occurred
	 * 0b00000100  Counter/timer 1 has run down (not implemented)
	 * 0b00001000  Counter/timer 2 has run down (not implemented)
	 * 0b00010000  Counter 3 has run down (not implemented)
	 * 0b00100000  Watchdog has run down (not implemented)
	 * 0b01000000  Voltage error
	 * 0b10000000  Short-circuit error
	 */
	comedi_buf_write_samples(s, &status, 1);
	comedi_handle_events(dev, s);
+5 −5
Original line number Diff line number Diff line
@@ -300,11 +300,11 @@ static int pci1710_ai_eoc(struct comedi_device *dev,
static int pci1710_ai_read_sample(struct comedi_device *dev,
				  struct comedi_subdevice *s,
				  unsigned int cur_chan,
				  unsigned int *val)
				  unsigned short *val)
{
	const struct boardtype *board = dev->board_ptr;
	struct pci1710_private *devpriv = dev->private;
	unsigned int sample;
	unsigned short sample;
	unsigned int chan;

	sample = inw(dev->iobase + PCI171X_AD_DATA_REG);
@@ -345,7 +345,7 @@ static int pci1710_ai_insn_read(struct comedi_device *dev,
	pci1710_ai_setup_chanlist(dev, s, &insn->chanspec, 1, 1);

	for (i = 0; i < insn->n; i++) {
		unsigned int val;
		unsigned short val;

		/* start conversion */
		outw(0, dev->iobase + PCI171X_SOFTTRG_REG);
@@ -395,7 +395,7 @@ static void pci1710_handle_every_sample(struct comedi_device *dev,
{
	struct comedi_cmd *cmd = &s->async->cmd;
	unsigned int status;
	unsigned int val;
	unsigned short val;
	int ret;

	status = inw(dev->iobase + PCI171X_STATUS_REG);
@@ -455,7 +455,7 @@ static void pci1710_handle_fifo(struct comedi_device *dev,
	}

	for (i = 0; i < devpriv->max_samples; i++) {
		unsigned int val;
		unsigned short val;
		int ret;

		ret = pci1710_ai_read_sample(dev, s, s->async->cur_chan, &val);
+3 −1
Original line number Diff line number Diff line
@@ -126,7 +126,9 @@ static irqreturn_t pc236_interrupt(int irq, void *d)

	handled = pc236_intr_check(dev);
	if (dev->attached && handled) {
		comedi_buf_write_samples(s, &s->state, 1);
		unsigned short val = 0;

		comedi_buf_write_samples(s, &val, 1);
		comedi_handle_events(dev, s);
	}
	return IRQ_RETVAL(handled);
+2 −1
Original line number Diff line number Diff line
@@ -210,12 +210,13 @@ static irqreturn_t parport_interrupt(int irq, void *d)
	struct comedi_device *dev = d;
	struct comedi_subdevice *s = dev->read_subdev;
	unsigned int ctrl;
	unsigned short val = 0;

	ctrl = inb(dev->iobase + PARPORT_CTRL_REG);
	if (!(ctrl & PARPORT_CTRL_IRQ_ENA))
		return IRQ_NONE;

	comedi_buf_write_samples(s, &s->state, 1);
	comedi_buf_write_samples(s, &val, 1);
	comedi_handle_events(dev, s);

	return IRQ_HANDLED;
Loading