Pull staging driver fixes from Greg Kroah-Hartman: "Here are some staging and IIO driver fixes for the 3.10-rc5 release. All of them are tiny, and fix a number of reported issues (build and runtime)" Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> * tag 'staging-3.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: iio:inkern: Fix typo/bug in convert raw to processed. iio: frequency: ad4350: Fix bug / typo in mask inkern: iio_device_put after incorrect return/goto staging: alarm-dev: information leak in alarm_compat_ioctl() iio:callback buffer: free the scan_mask staging: alarm-dev: information leak in alarm_ioctl() drivers: staging: zcache: fix compile error staging: dwc2: fix value of dma_mask
Unified · Split
| @@ -64,7 +64,7 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, · 63 unmodified lines | ||
| 64 | 64 | while (chan->indio_dev) { |
| 65 | 65 | if (chan->indio_dev != indio_dev) { |
| 66 | 66 | ret = -EINVAL; |
| 67 | − goto error_release_channels; | |
| 67 | + goto error_free_scan_mask; | |
| 68 | 68 | } |
| 69 | 69 | set_bit(chan->channel->scan_index, |
| 70 | 70 | cb_buff->buffer.scan_mask); |
| @@ -73,6 +73,8 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, · 2 unmodified lines | ||
| 73 | 73 | |
| 74 | 74 | return cb_buff; |
| 75 | 75 | |
| 76 | +error_free_scan_mask: | |
| 77 | + kfree(cb_buff->buffer.scan_mask); | |
| 76 | 78 | error_release_channels: |
| 77 | 79 | iio_channel_release_all(cb_buff->channels); |
| 78 | 80 | error_free_cb_buff: |
| @@ -100,6 +102,7 @@ EXPORT_SYMBOL_GPL(iio_channel_stop_all_cb); · 21 unmodified lines | ||
| 100 | 102 | |
| 101 | 103 | void iio_channel_release_all_cb(struct iio_cb_buffer *cb_buff) |
| 102 | 104 | { |
| 105 | + kfree(cb_buff->buffer.scan_mask); | |
| 103 | 106 | iio_channel_release_all(cb_buff->channels); |
| 104 | 107 | kfree(cb_buff); |
| 105 | 108 | } |
| @@ -212,7 +212,7 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq) · 211 unmodified lines | ||
| 212 | 212 | (pdata->r2_user_settings & (ADF4350_REG2_PD_POLARITY_POS | |
| 213 | 213 | ADF4350_REG2_LDP_6ns | ADF4350_REG2_LDF_INT_N | |
| 214 | 214 | ADF4350_REG2_CHARGE_PUMP_CURR_uA(5000) | |
| 215 | − ADF4350_REG2_MUXOUT(0x7) | ADF4350_REG2_NOISE_MODE(0x9))); | |
| 215 | + ADF4350_REG2_MUXOUT(0x7) | ADF4350_REG2_NOISE_MODE(0x3))); | |
| 216 | 216 | |
| 217 | 217 | st->regs[ADF4350_REG3] = pdata->r3_user_settings & |
| 218 | 218 | (ADF4350_REG3_12BIT_CLKDIV(0xFFF) | |
| @@ -124,7 +124,7 @@ static int __of_iio_channel_get(struct iio_channel *channel, · 123 unmodified lines | ||
| 124 | 124 | channel->indio_dev = indio_dev; |
| 125 | 125 | index = iiospec.args_count ? iiospec.args[0] : 0; |
| 126 | 126 | if (index >= indio_dev->num_channels) { |
| 127 | − return -EINVAL; | |
| 127 | + err = -EINVAL; | |
| 128 | 128 | goto err_put; |
| 129 | 129 | } |
| 130 | 130 | channel->channel = &indio_dev->channels[index]; |
| @@ -450,7 +450,7 @@ static int iio_convert_raw_to_processed_unlocked(struct iio_channel *chan, · 319 unmodified lines | ||
| 450 | 450 | s64 raw64 = raw; |
| 451 | 451 | int ret; |
| 452 | 452 | |
| 453 | − ret = iio_channel_read(chan, &offset, NULL, IIO_CHAN_INFO_SCALE); | |
| 453 | + ret = iio_channel_read(chan, &offset, NULL, IIO_CHAN_INFO_OFFSET); | |
| 454 | 454 | if (ret == 0) |
| 455 | 455 | raw64 += offset; |
| 456 | 456 | |
| @@ -264,6 +264,8 @@ static long alarm_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 263 unmodified lines | ||
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | rv = alarm_do_ioctl(file, cmd, &ts); |
| 267 | + if (rv) | |
| 268 | + return rv; | |
| 267 | 269 | |
| 268 | 270 | switch (ANDROID_ALARM_BASE_CMD(cmd)) { |
| 269 | 271 | case ANDROID_ALARM_GET_TIME(0): |
| @@ -272,7 +274,7 @@ static long alarm_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 2 unmodified lines | ||
| 272 | 274 | break; |
| 273 | 275 | } |
| 274 | 276 | |
| 275 | − return rv; | |
| 277 | + return 0; | |
| 276 | 278 | } |
| 277 | 279 | #ifdef CONFIG_COMPAT |
| 278 | 280 | static long alarm_compat_ioctl(struct file *file, unsigned int cmd, |
| @@ -295,6 +297,8 @@ static long alarm_compat_ioctl(struct file *file, unsigned int cmd, · 16 unmodified lines | ||
| 295 | 297 | } |
| 296 | 298 | |
| 297 | 299 | rv = alarm_do_ioctl(file, cmd, &ts); |
| 300 | + if (rv) | |
| 301 | + return rv; | |
| 298 | 302 | |
| 299 | 303 | switch (ANDROID_ALARM_BASE_CMD(cmd)) { |
| 300 | 304 | case ANDROID_ALARM_GET_TIME(0): /* NOTE: we modified cmd above */ |
| @@ -303,7 +307,7 @@ static long alarm_compat_ioctl(struct file *file, unsigned int cmd, · 2 unmodified lines | ||
| 303 | 307 | break; |
| 304 | 308 | } |
| 305 | 309 | |
| 306 | − return rv; | |
| 310 | + return 0; | |
| 307 | 311 | } |
| 308 | 312 | #endif |
| 309 | 313 | |
| @@ -2804,9 +2804,8 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq, · 2803 unmodified lines | ||
| 2804 | 2804 | |
| 2805 | 2805 | /* Set device flags indicating whether the HCD supports DMA */ |
| 2806 | 2806 | if (hsotg->core_params->dma_enable > 0) { |
| 2807 | − if (dma_set_mask(hsotg->dev, DMA_BIT_MASK(31)) < 0) | |
| 2808 | − dev_warn(hsotg->dev, | |
| 2809 | − "can't enable workaround for >2GB RAM\n"); | |
| 2807 | + if (dma_set_mask(hsotg->dev, DMA_BIT_MASK(32)) < 0) | |
| 2808 | + dev_warn(hsotg->dev, "can't set DMA mask\n"); | |
| 2810 | 2809 | if (dma_set_coherent_mask(hsotg->dev, DMA_BIT_MASK(31)) < 0) |
| 2811 | 2810 | dev_warn(hsotg->dev, |
| 2812 | 2811 | "can't enable workaround for >2GB RAM\n"); |
| @@ -11,10 +11,6 @@ · 10 unmodified lines | ||
| 11 | 11 | #ifndef _ZCACHE_RAMSTER_H_ |
| 12 | 12 | #define _ZCACHE_RAMSTER_H_ |
| 13 | 13 | |
| 14 | −#ifdef CONFIG_RAMSTER_MODULE | |
| 15 | −#define CONFIG_RAMSTER | |
| 16 | −#endif | |
| 17 | − | |
| 18 | 14 | #ifdef CONFIG_RAMSTER |
| 19 | 15 | #include "ramster/ramster.h" |
| 20 | 16 | #else |
| @@ -1,6 +1,8 @@ | ||
| 1 | 1 | #include <linux/atomic.h> |
| 2 | 2 | #include "debug.h" |
| 3 | 3 | |
| 4 | +ssize_t ramster_foreign_eph_pages; | |
| 5 | +ssize_t ramster_foreign_pers_pages; | |
| 4 | 6 | #ifdef CONFIG_DEBUG_FS |
| 5 | 7 | #include <linux/debugfs.h> |
| 6 | 8 | |
| @@ -66,8 +66,6 @@ static int ramster_remote_target_nodenum __read_mostly = -1; · 65 unmodified lines | ||
| 66 | 66 | |
| 67 | 67 | /* Used by this code. */ |
| 68 | 68 | long ramster_flnodes; |
| 69 | −ssize_t ramster_foreign_eph_pages; | |
| 70 | −ssize_t ramster_foreign_pers_pages; | |
| 71 | 69 | /* FIXME frontswap selfshrinking knobs in debugfs? */ |
| 72 | 70 | |
| 73 | 71 | static LIST_HEAD(ramster_rem_op_list); |
| @@ -399,14 +397,18 @@ void ramster_count_foreign_pages(bool eph, int count) · 325 unmodified lines | ||
| 399 | 397 | inc_ramster_foreign_eph_pages(); |
| 400 | 398 | } else { |
| 401 | 399 | dec_ramster_foreign_eph_pages(); |
| 400 | +#ifdef CONFIG_RAMSTER_DEBUG | |
| 402 | 401 | WARN_ON_ONCE(ramster_foreign_eph_pages < 0); |
| 402 | +#endif | |
| 403 | 403 | } |
| 404 | 404 | } else { |
| 405 | 405 | if (count > 0) { |
| 406 | 406 | inc_ramster_foreign_pers_pages(); |
| 407 | 407 | } else { |
| 408 | 408 | dec_ramster_foreign_pers_pages(); |
| 409 | +#ifdef CONFIG_RAMSTER_DEBUG | |
| 409 | 410 | WARN_ON_ONCE(ramster_foreign_pers_pages < 0); |
| 411 | +#endif | |
| 410 | 412 | } |
| 411 | 413 | } |
| 412 | 414 | } |