diff options
| -rw-r--r-- | drivers/iio/adc/npcm_adc.c | 2 | ||||
| -rw-r--r-- | drivers/iio/adc/ti-ads124s08.c | 2 | ||||
| -rw-r--r-- | drivers/iio/adc/ti-ads8688.c | 2 | ||||
| -rw-r--r-- | drivers/iio/dac/ds4424.c | 2 | ||||
| -rw-r--r-- | drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 46 | ||||
| -rw-r--r-- | drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 20 | ||||
| -rw-r--r-- | drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 3 | ||||
| -rw-r--r-- | drivers/staging/erofs/super.c | 1 | ||||
| -rw-r--r-- | drivers/staging/kpc2000/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/staging/kpc2000/kpc_dma/fileops.c | 4 | ||||
| -rw-r--r-- | drivers/staging/vc04_services/bcm2835-camera/controls.c | 4 | ||||
| -rw-r--r-- | drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 9 | ||||
| -rw-r--r-- | drivers/staging/wilc1000/wilc_wlan.c | 8 | ||||
| -rw-r--r-- | drivers/staging/wlan-ng/hfa384x_usb.c | 3 |
14 files changed, 91 insertions, 17 deletions
diff --git a/drivers/iio/adc/npcm_adc.c b/drivers/iio/adc/npcm_adc.c index 9e25bbec9c70..193b3b81de4d 100644 --- a/drivers/iio/adc/npcm_adc.c +++ b/drivers/iio/adc/npcm_adc.c | |||
| @@ -149,7 +149,7 @@ static int npcm_adc_read_raw(struct iio_dev *indio_dev, | |||
| 149 | } | 149 | } |
| 150 | return IIO_VAL_INT; | 150 | return IIO_VAL_INT; |
| 151 | case IIO_CHAN_INFO_SCALE: | 151 | case IIO_CHAN_INFO_SCALE: |
| 152 | if (info->vref) { | 152 | if (!IS_ERR(info->vref)) { |
| 153 | vref_uv = regulator_get_voltage(info->vref); | 153 | vref_uv = regulator_get_voltage(info->vref); |
| 154 | *val = vref_uv / 1000; | 154 | *val = vref_uv / 1000; |
| 155 | } else { | 155 | } else { |
diff --git a/drivers/iio/adc/ti-ads124s08.c b/drivers/iio/adc/ti-ads124s08.c index 53f17e4f2f23..552c2be8d87a 100644 --- a/drivers/iio/adc/ti-ads124s08.c +++ b/drivers/iio/adc/ti-ads124s08.c | |||
| @@ -202,7 +202,7 @@ static int ads124s_read(struct iio_dev *indio_dev, unsigned int chan) | |||
| 202 | }; | 202 | }; |
| 203 | 203 | ||
| 204 | priv->data[0] = ADS124S08_CMD_RDATA; | 204 | priv->data[0] = ADS124S08_CMD_RDATA; |
| 205 | memset(&priv->data[1], ADS124S08_CMD_NOP, sizeof(priv->data)); | 205 | memset(&priv->data[1], ADS124S08_CMD_NOP, sizeof(priv->data) - 1); |
| 206 | 206 | ||
| 207 | ret = spi_sync_transfer(priv->spi, t, ARRAY_SIZE(t)); | 207 | ret = spi_sync_transfer(priv->spi, t, ARRAY_SIZE(t)); |
| 208 | if (ret < 0) | 208 | if (ret < 0) |
diff --git a/drivers/iio/adc/ti-ads8688.c b/drivers/iio/adc/ti-ads8688.c index f9461070a74a..8cb7a2034982 100644 --- a/drivers/iio/adc/ti-ads8688.c +++ b/drivers/iio/adc/ti-ads8688.c | |||
| @@ -397,7 +397,7 @@ static irqreturn_t ads8688_trigger_handler(int irq, void *p) | |||
| 397 | } | 397 | } |
| 398 | 398 | ||
| 399 | iio_push_to_buffers_with_timestamp(indio_dev, buffer, | 399 | iio_push_to_buffers_with_timestamp(indio_dev, buffer, |
| 400 | pf->timestamp); | 400 | iio_get_time_ns(indio_dev)); |
| 401 | 401 | ||
| 402 | iio_trigger_notify_done(indio_dev->trig); | 402 | iio_trigger_notify_done(indio_dev->trig); |
| 403 | 403 | ||
diff --git a/drivers/iio/dac/ds4424.c b/drivers/iio/dac/ds4424.c index 883a47562055..714a97f91319 100644 --- a/drivers/iio/dac/ds4424.c +++ b/drivers/iio/dac/ds4424.c | |||
| @@ -166,7 +166,7 @@ static int ds4424_verify_chip(struct iio_dev *indio_dev) | |||
| 166 | { | 166 | { |
| 167 | int ret, val; | 167 | int ret, val; |
| 168 | 168 | ||
| 169 | ret = ds4424_get_value(indio_dev, &val, DS4424_DAC_ADDR(0)); | 169 | ret = ds4424_get_value(indio_dev, &val, 0); |
| 170 | if (ret < 0) | 170 | if (ret < 0) |
| 171 | dev_err(&indio_dev->dev, | 171 | dev_err(&indio_dev->dev, |
| 172 | "%s failed. ret: %d\n", __func__, ret); | 172 | "%s failed. ret: %d\n", __func__, ret); |
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c index 6138a6d86afb..c2916d2d552c 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | |||
| @@ -471,7 +471,10 @@ inv_mpu6050_read_raw(struct iio_dev *indio_dev, | |||
| 471 | return IIO_VAL_INT_PLUS_MICRO; | 471 | return IIO_VAL_INT_PLUS_MICRO; |
| 472 | case IIO_TEMP: | 472 | case IIO_TEMP: |
| 473 | *val = 0; | 473 | *val = 0; |
| 474 | *val2 = INV_MPU6050_TEMP_SCALE; | 474 | if (st->chip_type == INV_ICM20602) |
| 475 | *val2 = INV_ICM20602_TEMP_SCALE; | ||
| 476 | else | ||
| 477 | *val2 = INV_MPU6050_TEMP_SCALE; | ||
| 475 | 478 | ||
| 476 | return IIO_VAL_INT_PLUS_MICRO; | 479 | return IIO_VAL_INT_PLUS_MICRO; |
| 477 | default: | 480 | default: |
| @@ -480,7 +483,10 @@ inv_mpu6050_read_raw(struct iio_dev *indio_dev, | |||
| 480 | case IIO_CHAN_INFO_OFFSET: | 483 | case IIO_CHAN_INFO_OFFSET: |
| 481 | switch (chan->type) { | 484 | switch (chan->type) { |
| 482 | case IIO_TEMP: | 485 | case IIO_TEMP: |
| 483 | *val = INV_MPU6050_TEMP_OFFSET; | 486 | if (st->chip_type == INV_ICM20602) |
| 487 | *val = INV_ICM20602_TEMP_OFFSET; | ||
| 488 | else | ||
| 489 | *val = INV_MPU6050_TEMP_OFFSET; | ||
| 484 | 490 | ||
| 485 | return IIO_VAL_INT; | 491 | return IIO_VAL_INT; |
| 486 | default: | 492 | default: |
| @@ -847,6 +853,32 @@ static const struct iio_chan_spec inv_mpu_channels[] = { | |||
| 847 | INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Z, INV_MPU6050_SCAN_ACCL_Z), | 853 | INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Z, INV_MPU6050_SCAN_ACCL_Z), |
| 848 | }; | 854 | }; |
| 849 | 855 | ||
| 856 | static const struct iio_chan_spec inv_icm20602_channels[] = { | ||
| 857 | IIO_CHAN_SOFT_TIMESTAMP(INV_ICM20602_SCAN_TIMESTAMP), | ||
| 858 | { | ||
| 859 | .type = IIO_TEMP, | ||
| 860 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | ||
| 861 | | BIT(IIO_CHAN_INFO_OFFSET) | ||
| 862 | | BIT(IIO_CHAN_INFO_SCALE), | ||
| 863 | .scan_index = INV_ICM20602_SCAN_TEMP, | ||
| 864 | .scan_type = { | ||
| 865 | .sign = 's', | ||
| 866 | .realbits = 16, | ||
| 867 | .storagebits = 16, | ||
| 868 | .shift = 0, | ||
| 869 | .endianness = IIO_BE, | ||
| 870 | }, | ||
| 871 | }, | ||
| 872 | |||
| 873 | INV_MPU6050_CHAN(IIO_ANGL_VEL, IIO_MOD_X, INV_ICM20602_SCAN_GYRO_X), | ||
| 874 | INV_MPU6050_CHAN(IIO_ANGL_VEL, IIO_MOD_Y, INV_ICM20602_SCAN_GYRO_Y), | ||
| 875 | INV_MPU6050_CHAN(IIO_ANGL_VEL, IIO_MOD_Z, INV_ICM20602_SCAN_GYRO_Z), | ||
| 876 | |||
| 877 | INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Y, INV_ICM20602_SCAN_ACCL_Y), | ||
| 878 | INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_X, INV_ICM20602_SCAN_ACCL_X), | ||
| 879 | INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Z, INV_ICM20602_SCAN_ACCL_Z), | ||
| 880 | }; | ||
| 881 | |||
| 850 | /* | 882 | /* |
| 851 | * The user can choose any frequency between INV_MPU6050_MIN_FIFO_RATE and | 883 | * The user can choose any frequency between INV_MPU6050_MIN_FIFO_RATE and |
| 852 | * INV_MPU6050_MAX_FIFO_RATE, but only these frequencies are matched by the | 884 | * INV_MPU6050_MAX_FIFO_RATE, but only these frequencies are matched by the |
| @@ -1102,8 +1134,14 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name, | |||
| 1102 | indio_dev->name = name; | 1134 | indio_dev->name = name; |
| 1103 | else | 1135 | else |
| 1104 | indio_dev->name = dev_name(dev); | 1136 | indio_dev->name = dev_name(dev); |
| 1105 | indio_dev->channels = inv_mpu_channels; | 1137 | |
| 1106 | indio_dev->num_channels = ARRAY_SIZE(inv_mpu_channels); | 1138 | if (chip_type == INV_ICM20602) { |
| 1139 | indio_dev->channels = inv_icm20602_channels; | ||
| 1140 | indio_dev->num_channels = ARRAY_SIZE(inv_icm20602_channels); | ||
| 1141 | } else { | ||
| 1142 | indio_dev->channels = inv_mpu_channels; | ||
| 1143 | indio_dev->num_channels = ARRAY_SIZE(inv_mpu_channels); | ||
| 1144 | } | ||
| 1107 | 1145 | ||
| 1108 | indio_dev->info = &mpu_info; | 1146 | indio_dev->info = &mpu_info; |
| 1109 | indio_dev->modes = INDIO_BUFFER_TRIGGERED; | 1147 | indio_dev->modes = INDIO_BUFFER_TRIGGERED; |
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h index 325afd9f5f61..3d5fe4474378 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | |||
| @@ -208,6 +208,9 @@ struct inv_mpu6050_state { | |||
| 208 | #define INV_MPU6050_BYTES_PER_3AXIS_SENSOR 6 | 208 | #define INV_MPU6050_BYTES_PER_3AXIS_SENSOR 6 |
| 209 | #define INV_MPU6050_FIFO_COUNT_BYTE 2 | 209 | #define INV_MPU6050_FIFO_COUNT_BYTE 2 |
| 210 | 210 | ||
| 211 | /* ICM20602 FIFO samples include temperature readings */ | ||
| 212 | #define INV_ICM20602_BYTES_PER_TEMP_SENSOR 2 | ||
| 213 | |||
| 211 | /* mpu6500 registers */ | 214 | /* mpu6500 registers */ |
| 212 | #define INV_MPU6500_REG_ACCEL_CONFIG_2 0x1D | 215 | #define INV_MPU6500_REG_ACCEL_CONFIG_2 0x1D |
| 213 | #define INV_MPU6500_REG_ACCEL_OFFSET 0x77 | 216 | #define INV_MPU6500_REG_ACCEL_OFFSET 0x77 |
| @@ -229,6 +232,9 @@ struct inv_mpu6050_state { | |||
| 229 | #define INV_MPU6050_GYRO_CONFIG_FSR_SHIFT 3 | 232 | #define INV_MPU6050_GYRO_CONFIG_FSR_SHIFT 3 |
| 230 | #define INV_MPU6050_ACCL_CONFIG_FSR_SHIFT 3 | 233 | #define INV_MPU6050_ACCL_CONFIG_FSR_SHIFT 3 |
| 231 | 234 | ||
| 235 | #define INV_ICM20602_TEMP_OFFSET 8170 | ||
| 236 | #define INV_ICM20602_TEMP_SCALE 3060 | ||
| 237 | |||
| 232 | /* 6 + 6 round up and plus 8 */ | 238 | /* 6 + 6 round up and plus 8 */ |
| 233 | #define INV_MPU6050_OUTPUT_DATA_SIZE 24 | 239 | #define INV_MPU6050_OUTPUT_DATA_SIZE 24 |
| 234 | 240 | ||
| @@ -270,7 +276,7 @@ struct inv_mpu6050_state { | |||
| 270 | #define INV_ICM20608_WHOAMI_VALUE 0xAF | 276 | #define INV_ICM20608_WHOAMI_VALUE 0xAF |
| 271 | #define INV_ICM20602_WHOAMI_VALUE 0x12 | 277 | #define INV_ICM20602_WHOAMI_VALUE 0x12 |
| 272 | 278 | ||
| 273 | /* scan element definition */ | 279 | /* scan element definition for generic MPU6xxx devices */ |
| 274 | enum inv_mpu6050_scan { | 280 | enum inv_mpu6050_scan { |
| 275 | INV_MPU6050_SCAN_ACCL_X, | 281 | INV_MPU6050_SCAN_ACCL_X, |
| 276 | INV_MPU6050_SCAN_ACCL_Y, | 282 | INV_MPU6050_SCAN_ACCL_Y, |
| @@ -281,6 +287,18 @@ enum inv_mpu6050_scan { | |||
| 281 | INV_MPU6050_SCAN_TIMESTAMP, | 287 | INV_MPU6050_SCAN_TIMESTAMP, |
| 282 | }; | 288 | }; |
| 283 | 289 | ||
| 290 | /* scan element definition for ICM20602, which includes temperature */ | ||
| 291 | enum inv_icm20602_scan { | ||
| 292 | INV_ICM20602_SCAN_ACCL_X, | ||
| 293 | INV_ICM20602_SCAN_ACCL_Y, | ||
| 294 | INV_ICM20602_SCAN_ACCL_Z, | ||
| 295 | INV_ICM20602_SCAN_TEMP, | ||
| 296 | INV_ICM20602_SCAN_GYRO_X, | ||
| 297 | INV_ICM20602_SCAN_GYRO_Y, | ||
| 298 | INV_ICM20602_SCAN_GYRO_Z, | ||
| 299 | INV_ICM20602_SCAN_TIMESTAMP, | ||
| 300 | }; | ||
| 301 | |||
| 284 | enum inv_mpu6050_filter_e { | 302 | enum inv_mpu6050_filter_e { |
| 285 | INV_MPU6050_FILTER_256HZ_NOLPF2 = 0, | 303 | INV_MPU6050_FILTER_256HZ_NOLPF2 = 0, |
| 286 | INV_MPU6050_FILTER_188HZ, | 304 | INV_MPU6050_FILTER_188HZ, |
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c index 548e042f7b5b..57bd11bde56b 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | |||
| @@ -207,6 +207,9 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p) | |||
| 207 | if (st->chip_config.gyro_fifo_enable) | 207 | if (st->chip_config.gyro_fifo_enable) |
| 208 | bytes_per_datum += INV_MPU6050_BYTES_PER_3AXIS_SENSOR; | 208 | bytes_per_datum += INV_MPU6050_BYTES_PER_3AXIS_SENSOR; |
| 209 | 209 | ||
| 210 | if (st->chip_type == INV_ICM20602) | ||
| 211 | bytes_per_datum += INV_ICM20602_BYTES_PER_TEMP_SENSOR; | ||
| 212 | |||
| 210 | /* | 213 | /* |
| 211 | * read fifo_count register to know how many bytes are inside the FIFO | 214 | * read fifo_count register to know how many bytes are inside the FIFO |
| 212 | * right now | 215 | * right now |
diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c index 399847d21146..f580d4ef77a1 100644 --- a/drivers/staging/erofs/super.c +++ b/drivers/staging/erofs/super.c | |||
| @@ -457,6 +457,7 @@ static int erofs_read_super(struct super_block *sb, | |||
| 457 | */ | 457 | */ |
| 458 | err_devname: | 458 | err_devname: |
| 459 | dput(sb->s_root); | 459 | dput(sb->s_root); |
| 460 | sb->s_root = NULL; | ||
| 460 | err_iget: | 461 | err_iget: |
| 461 | #ifdef EROFS_FS_HAS_MANAGED_CACHE | 462 | #ifdef EROFS_FS_HAS_MANAGED_CACHE |
| 462 | iput(sbi->managed_cache); | 463 | iput(sbi->managed_cache); |
diff --git a/drivers/staging/kpc2000/Kconfig b/drivers/staging/kpc2000/Kconfig index fb5922928f47..3bb2efd511c4 100644 --- a/drivers/staging/kpc2000/Kconfig +++ b/drivers/staging/kpc2000/Kconfig | |||
| @@ -2,7 +2,9 @@ | |||
| 2 | 2 | ||
| 3 | config KPC2000 | 3 | config KPC2000 |
| 4 | bool "Daktronics KPC Device support" | 4 | bool "Daktronics KPC Device support" |
| 5 | select MFD_CORE | ||
| 5 | depends on PCI | 6 | depends on PCI |
| 7 | depends on UIO | ||
| 6 | help | 8 | help |
| 7 | Select this if you wish to use the Daktronics KPC PCI devices | 9 | Select this if you wish to use the Daktronics KPC PCI devices |
| 8 | 10 | ||
diff --git a/drivers/staging/kpc2000/kpc_dma/fileops.c b/drivers/staging/kpc2000/kpc_dma/fileops.c index 5741d2b49a7d..616658709bd9 100644 --- a/drivers/staging/kpc2000/kpc_dma/fileops.c +++ b/drivers/staging/kpc2000/kpc_dma/fileops.c | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #include <linux/errno.h> /* error codes */ | 8 | #include <linux/errno.h> /* error codes */ |
| 9 | #include <linux/types.h> /* size_t */ | 9 | #include <linux/types.h> /* size_t */ |
| 10 | #include <linux/cdev.h> | 10 | #include <linux/cdev.h> |
| 11 | #include <asm/uaccess.h> /* copy_*_user */ | 11 | #include <linux/uaccess.h> /* copy_*_user */ |
| 12 | #include <linux/aio.h> /* aio stuff */ | 12 | #include <linux/aio.h> /* aio stuff */ |
| 13 | #include <linux/highmem.h> | 13 | #include <linux/highmem.h> |
| 14 | #include <linux/pagemap.h> | 14 | #include <linux/pagemap.h> |
| @@ -116,13 +116,11 @@ int kpc_dma_transfer(struct dev_private_data *priv, struct kiocb *kcb, unsigned | |||
| 116 | if (desc_needed >= ldev->desc_pool_cnt){ | 116 | if (desc_needed >= ldev->desc_pool_cnt){ |
| 117 | dev_warn(&priv->ldev->pldev->dev, " mapped_entry_count = %d num_descrs_needed = %d num_descrs_avail = %d TOO MANY to ever complete!\n", acd->mapped_entry_count, desc_needed, num_descrs_avail); | 117 | dev_warn(&priv->ldev->pldev->dev, " mapped_entry_count = %d num_descrs_needed = %d num_descrs_avail = %d TOO MANY to ever complete!\n", acd->mapped_entry_count, desc_needed, num_descrs_avail); |
| 118 | rv = -EAGAIN; | 118 | rv = -EAGAIN; |
| 119 | unlock_engine(ldev); | ||
| 120 | goto err_descr_too_many; | 119 | goto err_descr_too_many; |
| 121 | } | 120 | } |
| 122 | if (desc_needed > num_descrs_avail){ | 121 | if (desc_needed > num_descrs_avail){ |
| 123 | dev_warn(&priv->ldev->pldev->dev, " mapped_entry_count = %d num_descrs_needed = %d num_descrs_avail = %d Too many to complete right now.\n", acd->mapped_entry_count, desc_needed, num_descrs_avail); | 122 | dev_warn(&priv->ldev->pldev->dev, " mapped_entry_count = %d num_descrs_needed = %d num_descrs_avail = %d Too many to complete right now.\n", acd->mapped_entry_count, desc_needed, num_descrs_avail); |
| 124 | rv = -EMSGSIZE; | 123 | rv = -EMSGSIZE; |
| 125 | unlock_engine(ldev); | ||
| 126 | goto err_descr_too_many; | 124 | goto err_descr_too_many; |
| 127 | } | 125 | } |
| 128 | 126 | ||
diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c index 9841c30450ce..dade79738a29 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c | |||
| @@ -572,7 +572,7 @@ exit: | |||
| 572 | dev->colourfx.enable ? "true" : "false", | 572 | dev->colourfx.enable ? "true" : "false", |
| 573 | dev->colourfx.u, dev->colourfx.v, | 573 | dev->colourfx.u, dev->colourfx.v, |
| 574 | ret, (ret == 0 ? 0 : -EINVAL)); | 574 | ret, (ret == 0 ? 0 : -EINVAL)); |
| 575 | return (ret == 0 ? 0 : EINVAL); | 575 | return (ret == 0 ? 0 : -EINVAL); |
| 576 | } | 576 | } |
| 577 | 577 | ||
| 578 | static int ctrl_set_colfx(struct bm2835_mmal_dev *dev, | 578 | static int ctrl_set_colfx(struct bm2835_mmal_dev *dev, |
| @@ -596,7 +596,7 @@ static int ctrl_set_colfx(struct bm2835_mmal_dev *dev, | |||
| 596 | "%s: After: mmal_ctrl:%p ctrl id:0x%x ctrl val:%d ret %d(%d)\n", | 596 | "%s: After: mmal_ctrl:%p ctrl id:0x%x ctrl val:%d ret %d(%d)\n", |
| 597 | __func__, mmal_ctrl, ctrl->id, ctrl->val, ret, | 597 | __func__, mmal_ctrl, ctrl->id, ctrl->val, ret, |
| 598 | (ret == 0 ? 0 : -EINVAL)); | 598 | (ret == 0 ? 0 : -EINVAL)); |
| 599 | return (ret == 0 ? 0 : EINVAL); | 599 | return (ret == 0 ? 0 : -EINVAL); |
| 600 | } | 600 | } |
| 601 | 601 | ||
| 602 | static int ctrl_set_bitrate(struct bm2835_mmal_dev *dev, | 602 | static int ctrl_set_bitrate(struct bm2835_mmal_dev *dev, |
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c index a9a22917ecdb..c557c9953724 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | |||
| @@ -368,9 +368,18 @@ create_pagelist(char __user *buf, size_t count, unsigned short type) | |||
| 368 | int dma_buffers; | 368 | int dma_buffers; |
| 369 | dma_addr_t dma_addr; | 369 | dma_addr_t dma_addr; |
| 370 | 370 | ||
| 371 | if (count >= INT_MAX - PAGE_SIZE) | ||
| 372 | return NULL; | ||
| 373 | |||
| 371 | offset = ((unsigned int)(unsigned long)buf & (PAGE_SIZE - 1)); | 374 | offset = ((unsigned int)(unsigned long)buf & (PAGE_SIZE - 1)); |
| 372 | num_pages = DIV_ROUND_UP(count + offset, PAGE_SIZE); | 375 | num_pages = DIV_ROUND_UP(count + offset, PAGE_SIZE); |
| 373 | 376 | ||
| 377 | if (num_pages > (SIZE_MAX - sizeof(struct pagelist) - | ||
| 378 | sizeof(struct vchiq_pagelist_info)) / | ||
| 379 | (sizeof(u32) + sizeof(pages[0]) + | ||
| 380 | sizeof(struct scatterlist))) | ||
| 381 | return NULL; | ||
| 382 | |||
| 374 | pagelist_size = sizeof(struct pagelist) + | 383 | pagelist_size = sizeof(struct pagelist) + |
| 375 | (num_pages * sizeof(u32)) + | 384 | (num_pages * sizeof(u32)) + |
| 376 | (num_pages * sizeof(pages[0]) + | 385 | (num_pages * sizeof(pages[0]) + |
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 0a713409ea98..95eaf8fdf4f2 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c | |||
| @@ -1076,13 +1076,17 @@ void wilc_wlan_cleanup(struct net_device *dev) | |||
| 1076 | acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); | 1076 | acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); |
| 1077 | 1077 | ||
| 1078 | ret = wilc->hif_func->hif_read_reg(wilc, WILC_GP_REG_0, ®); | 1078 | ret = wilc->hif_func->hif_read_reg(wilc, WILC_GP_REG_0, ®); |
| 1079 | if (!ret) | 1079 | if (!ret) { |
| 1080 | release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); | 1080 | release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); |
| 1081 | return; | ||
| 1082 | } | ||
| 1081 | 1083 | ||
| 1082 | ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_0, | 1084 | ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_0, |
| 1083 | (reg | ABORT_INT)); | 1085 | (reg | ABORT_INT)); |
| 1084 | if (!ret) | 1086 | if (!ret) { |
| 1085 | release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); | 1087 | release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); |
| 1088 | return; | ||
| 1089 | } | ||
| 1086 | 1090 | ||
| 1087 | release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); | 1091 | release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); |
| 1088 | wilc->hif_func->hif_deinit(NULL); | 1092 | wilc->hif_func->hif_deinit(NULL); |
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index 6fde75d4f064..ab734534093b 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c | |||
| @@ -3119,7 +3119,9 @@ static void hfa384x_usbin_callback(struct urb *urb) | |||
| 3119 | break; | 3119 | break; |
| 3120 | } | 3120 | } |
| 3121 | 3121 | ||
| 3122 | /* Save values from the RX URB before reposting overwrites it. */ | ||
| 3122 | urb_status = urb->status; | 3123 | urb_status = urb->status; |
| 3124 | usbin = (union hfa384x_usbin *)urb->transfer_buffer; | ||
| 3123 | 3125 | ||
| 3124 | if (action != ABORT) { | 3126 | if (action != ABORT) { |
| 3125 | /* Repost the RX URB */ | 3127 | /* Repost the RX URB */ |
| @@ -3136,7 +3138,6 @@ static void hfa384x_usbin_callback(struct urb *urb) | |||
| 3136 | /* Note: the check of the sw_support field, the type field doesn't | 3138 | /* Note: the check of the sw_support field, the type field doesn't |
| 3137 | * have bit 12 set like the docs suggest. | 3139 | * have bit 12 set like the docs suggest. |
| 3138 | */ | 3140 | */ |
| 3139 | usbin = (union hfa384x_usbin *)urb->transfer_buffer; | ||
| 3140 | type = le16_to_cpu(usbin->type); | 3141 | type = le16_to_cpu(usbin->type); |
| 3141 | if (HFA384x_USB_ISRXFRM(type)) { | 3142 | if (HFA384x_USB_ISRXFRM(type)) { |
| 3142 | if (action == HANDLE) { | 3143 | if (action == HANDLE) { |
