History

Merge tag 'staging-3.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging fixes from Greg KH: "Here are some staging driver fixes for 3.18-rc3. Mostly iio and comedi driver fixes for issues reported by people. All of these have been in linux-next for a while with no reported issues" * tag 'staging-3.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: comedi: fix memory leak / bad pointer freeing for chanlist staging: comedi: Kconfig: fix config COMEDI_ADDI_APCI_3120 dependants staging: comedi: widen subdevice number argument in ioctl handlers staging: rtl8723au: Fix alignment of mac_addr for ether_addr_copy() usage drivers/staging/comedi/Kconfig: Let COMEDI_II_PCI20KC depend on HAS_IOMEM staging: comedi: (regression) channel list must be set for COMEDI_CMD ioctl iio: adc: mxs-lradc: Disable the clock on probe failure iio: st_sensors: Fix buffer copy staging:iio:ad5933: Drop "raw" from channel names staging:iio:ad5933: Fix NULL pointer deref when enabling buffer

Linus Torvalds committed 12 years ago

Commit 12d7aac2 parents 528a506 238b5ad6 files · +31 −28Browse files

Unified · Split

6 files
  1. drivers/iio/common/st_sensors/st_sensors_buffer.c +1 −1
  2. drivers/staging/comedi/Kconfig +1 −1
  3. drivers/staging/comedi/comedi_fops.c +14 −12
  4. drivers/staging/iio/adc/mxs-lradc.c +8 −4
  5. drivers/staging/iio/impedance-analyzer/ad5933.c +6 −9
  6. drivers/staging/rtl8723au/include/rtw_eeprom.h +1 −1
drivers/iio/common/st_sensors/st_sensors_buffer.c+1−1
@@ -71,7 +71,7 @@ int st_sensors_get_buffer_element(struct iio_dev *indio_dev, u8 *buf) · 70 unmodified lines
7171 goto st_sensors_free_memory;
7272 }
7373
74− for (i = 0; i < n * num_data_channels; i++) {
74+ for (i = 0; i < n * byte_for_channel; i++) {
7575 if (i < n)
7676 buf[i] = rx_array[i];
7777 else
drivers/staging/comedi/Kconfig+1−1
@@ -426,6 +426,7 @@ config COMEDI_AIO_IIRO_16 · 425 unmodified lines
426426
427427 config COMEDI_II_PCI20KC
428428 tristate "Intelligent Instruments PCI-20001C carrier support"
429+ depends on HAS_IOMEM
429430 ---help---
430431 Enable support for Intelligent Instruments PCI-20001C carrier
431432 PCI-20001, PCI-20006 and PCI-20341
@@ -667,7 +668,6 @@ config COMEDI_ADDI_APCI_2200 · 235 unmodified lines
667668 config COMEDI_ADDI_APCI_3120
668669 tristate "ADDI-DATA APCI_3120/3001 support"
669670 depends on HAS_DMA
670− depends on VIRT_TO_BUS
671671 ---help---
672672 Enable support for ADDI-DATA APCI_3120/3001 cards
673673
drivers/staging/comedi/comedi_fops.c+14−12
@@ -1462,10 +1462,7 @@ static int __comedi_get_user_chanlist(struct comedi_device *dev, · 1461 unmodified lines
14621462 unsigned int *chanlist;
14631463 int ret;
14641464
1465− /* user_chanlist could be NULL for do_cmdtest ioctls */
1466− if (!user_chanlist)
1467− return 0;
1468−
1465+ cmd->chanlist = NULL;
14691466 chanlist = memdup_user(user_chanlist,
14701467 cmd->chanlist_len * sizeof(unsigned int));
14711468 if (IS_ERR(chanlist))
@@ -1609,13 +1606,18 @@ static int do_cmdtest_ioctl(struct comedi_device *dev, · 137 unmodified lines
16091606
16101607 s = &dev->subdevices[cmd.subdev];
16111608
1612− /* load channel/gain list */
1613− ret = __comedi_get_user_chanlist(dev, s, user_chanlist, &cmd);
1614− if (ret)
1615− return ret;
1609+ /* user_chanlist can be NULL for COMEDI_CMDTEST ioctl */
1610+ if (user_chanlist) {
1611+ /* load channel/gain list */
1612+ ret = __comedi_get_user_chanlist(dev, s, user_chanlist, &cmd);
1613+ if (ret)
1614+ return ret;
1615+ }
16161616
16171617 ret = s->do_cmdtest(dev, s, &cmd);
16181618
1619+ kfree(cmd.chanlist); /* free kernel copy of user chanlist */
1620+
16191621 /* restore chanlist pointer before copying back */
16201622 cmd.chanlist = (unsigned int __force *)user_chanlist;
16211623
@@ -1642,7 +1644,7 @@ static int do_cmdtest_ioctl(struct comedi_device *dev, · 20 unmodified lines
16421644
16431645 */
16441646
1645−static int do_lock_ioctl(struct comedi_device *dev, unsigned int arg,
1647+static int do_lock_ioctl(struct comedi_device *dev, unsigned long arg,
16461648 void *file)
16471649 {
16481650 int ret = 0;
@@ -1679,7 +1681,7 @@ static int do_lock_ioctl(struct comedi_device *dev, unsigned int arg, · 30 unmodified lines
16791681 This function isn't protected by the semaphore, since
16801682 we already own the lock.
16811683 */
1682−static int do_unlock_ioctl(struct comedi_device *dev, unsigned int arg,
1684+static int do_unlock_ioctl(struct comedi_device *dev, unsigned long arg,
16831685 void *file)
16841686 {
16851687 struct comedi_subdevice *s;
@@ -1714,7 +1716,7 @@ static int do_unlock_ioctl(struct comedi_device *dev, unsigned int arg, · 28 unmodified lines
17141716 nothing
17151717
17161718 */
1717−static int do_cancel_ioctl(struct comedi_device *dev, unsigned int arg,
1719+static int do_cancel_ioctl(struct comedi_device *dev, unsigned long arg,
17181720 void *file)
17191721 {
17201722 struct comedi_subdevice *s;
@@ -1751,7 +1753,7 @@ static int do_cancel_ioctl(struct comedi_device *dev, unsigned int arg, · 30 unmodified lines
17511753 nothing
17521754
17531755 */
1754−static int do_poll_ioctl(struct comedi_device *dev, unsigned int arg,
1756+static int do_poll_ioctl(struct comedi_device *dev, unsigned long arg,
17551757 void *file)
17561758 {
17571759 struct comedi_subdevice *s;
drivers/staging/iio/adc/mxs-lradc.c+8−4
@@ -1559,14 +1559,16 @@ static int mxs_lradc_probe(struct platform_device *pdev) · 1558 unmodified lines
15591559 /* Grab all IRQ sources */
15601560 for (i = 0; i < of_cfg->irq_count; i++) {
15611561 lradc->irq[i] = platform_get_irq(pdev, i);
1562− if (lradc->irq[i] < 0)
1563− return lradc->irq[i];
1562+ if (lradc->irq[i] < 0) {
1563+ ret = lradc->irq[i];
1564+ goto err_clk;
1565+ }
15641566
15651567 ret = devm_request_irq(dev, lradc->irq[i],
15661568 mxs_lradc_handle_irq, 0,
15671569 of_cfg->irq_name[i], iio);
15681570 if (ret)
1569− return ret;
1571+ goto err_clk;
15701572 }
15711573
15721574 lradc->vref_mv = of_cfg->vref_mv;
@@ -1588,7 +1590,7 @@ static int mxs_lradc_probe(struct platform_device *pdev) · 15 unmodified lines
15881590 &mxs_lradc_trigger_handler,
15891591 &mxs_lradc_buffer_ops);
15901592 if (ret)
1591− return ret;
1593+ goto err_clk;
15921594
15931595 ret = mxs_lradc_trigger_init(iio);
15941596 if (ret)
@@ -1643,6 +1645,8 @@ err_dev: · 48 unmodified lines
16431645 mxs_lradc_trigger_remove(iio);
16441646 err_trig:
16451647 iio_triggered_buffer_cleanup(iio);
1648+err_clk:
1649+ clk_disable_unprepare(lradc->clk);
16461650 return ret;
16471651 }
16481652
drivers/staging/iio/impedance-analyzer/ad5933.c+6−9
@@ -115,6 +115,7 @@ static const struct iio_chan_spec ad5933_channels[] = { · 114 unmodified lines
115115 .channel = 0,
116116 .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED),
117117 .address = AD5933_REG_TEMP_DATA,
118+ .scan_index = -1,
118119 .scan_type = {
119120 .sign = 's',
120121 .realbits = 14,
@@ -124,9 +125,7 @@ static const struct iio_chan_spec ad5933_channels[] = { · 3 unmodified lines
124125 .type = IIO_VOLTAGE,
125126 .indexed = 1,
126127 .channel = 0,
127− .extend_name = "real_raw",
128− .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
129− BIT(IIO_CHAN_INFO_SCALE),
128+ .extend_name = "real",
130129 .address = AD5933_REG_REAL_DATA,
131130 .scan_index = 0,
132131 .scan_type = {
@@ -138,9 +137,7 @@ static const struct iio_chan_spec ad5933_channels[] = { · 5 unmodified lines
138137 .type = IIO_VOLTAGE,
139138 .indexed = 1,
140139 .channel = 0,
141− .extend_name = "imag_raw",
142− .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
143− BIT(IIO_CHAN_INFO_SCALE),
140+ .extend_name = "imag",
144141 .address = AD5933_REG_IMAG_DATA,
145142 .scan_index = 1,
146143 .scan_type = {
@@ -749,14 +746,14 @@ static int ad5933_probe(struct i2c_client *client, · 602 unmodified lines
749746 indio_dev->name = id->name;
750747 indio_dev->modes = INDIO_DIRECT_MODE;
751748 indio_dev->channels = ad5933_channels;
752− indio_dev->num_channels = 1; /* only register temp0_input */
749+ indio_dev->num_channels = ARRAY_SIZE(ad5933_channels);
753750
754751 ret = ad5933_register_ring_funcs_and_init(indio_dev);
755752 if (ret)
756753 goto error_disable_reg;
757754
758− /* skip temp0_input, register in0_(real|imag)_raw */
759− ret = iio_buffer_register(indio_dev, &ad5933_channels[1], 2);
755+ ret = iio_buffer_register(indio_dev, ad5933_channels,
756+ ARRAY_SIZE(ad5933_channels));
760757 if (ret)
761758 goto error_unreg_ring;
762759
drivers/staging/rtl8723au/include/rtw_eeprom.h+1−1
@@ -107,12 +107,12 @@ enum rt_customer_id · 106 unmodified lines
107107 };
108108
109109 struct eeprom_priv {
110+ u8 mac_addr[6]; /* PermanentAddress */
110111 u8 bautoload_fail_flag;
111112 u8 bloadfile_fail_flag;
112113 u8 bloadmac_fail_flag;
113114 /* u8 bempty; */
114115 /* u8 sys_config; */
115− u8 mac_addr[6]; /* PermanentAddress */
116116 /* u8 config0; */
117117 u16 channel_plan;
118118 /* u8 country_string[3]; */