Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull staging driver fixes from Greg KH:
"Here are a few staging and IIO driver fixes for 4.4-rc5.

All of them resolve reported problems and have been in linux-next for
a while. Nothing major here, just small fixes where needed"

* tag 'staging-4.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
staging: lustre: echo_copy.._lsm() dereferences userland pointers directly
iio: adc: spmi-vadc: add missing of_node_put
iio: fix some warning messages
iio: light: apds9960: correct ->last_busy count
iio: lidar: return -EINVAL on invalid signal
staging: iio: dummy: complete IIO events delivery to userspace

+21 -16
+3 -1
drivers/iio/adc/qcom-spmi-vadc.c
··· 839 839 840 840 for_each_available_child_of_node(node, child) { 841 841 ret = vadc_get_dt_channel_data(vadc->dev, &prop, child); 842 - if (ret) 842 + if (ret) { 843 + of_node_put(child); 843 844 return ret; 845 + } 844 846 845 847 vadc->chan_props[index] = prop; 846 848
+1 -1
drivers/iio/industrialio-buffer.c
··· 302 302 if (trialmask == NULL) 303 303 return -ENOMEM; 304 304 if (!indio_dev->masklength) { 305 - WARN_ON("Trying to set scanmask prior to registering buffer\n"); 305 + WARN(1, "Trying to set scanmask prior to registering buffer\n"); 306 306 goto err_invalid_mask; 307 307 } 308 308 bitmap_copy(trialmask, buffer->scan_mask, indio_dev->masklength);
+1 -1
drivers/iio/industrialio-core.c
··· 655 655 break; 656 656 case IIO_SEPARATE: 657 657 if (!chan->indexed) { 658 - WARN_ON("Differential channels must be indexed\n"); 658 + WARN(1, "Differential channels must be indexed\n"); 659 659 ret = -EINVAL; 660 660 goto error_free_full_postfix; 661 661 }
+1
drivers/iio/light/apds9960.c
··· 453 453 usleep_range(data->als_adc_int_us, 454 454 APDS9960_MAX_INT_TIME_IN_US); 455 455 } else { 456 + pm_runtime_mark_last_busy(dev); 456 457 ret = pm_runtime_put_autosuspend(dev); 457 458 } 458 459
+3 -3
drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
··· 130 130 if (ret < 0) 131 131 break; 132 132 133 - /* return 0 since laser is likely pointed out of range */ 133 + /* return -EINVAL since laser is likely pointed out of range */ 134 134 if (ret & LIDAR_REG_STATUS_INVALID) { 135 135 *reg = 0; 136 - ret = 0; 136 + ret = -EINVAL; 137 137 break; 138 138 } 139 139 ··· 197 197 if (!ret) { 198 198 iio_push_to_buffers_with_timestamp(indio_dev, data->buffer, 199 199 iio_get_time_ns()); 200 - } else { 200 + } else if (ret != -EINVAL) { 201 201 dev_err(&data->client->dev, "cannot read LIDAR measurement"); 202 202 } 203 203
+1 -1
drivers/staging/iio/iio_simple_dummy_events.c
··· 159 159 struct iio_dummy_state *st = iio_priv(indio_dev); 160 160 161 161 st->event_timestamp = iio_get_time_ns(); 162 - return IRQ_HANDLED; 162 + return IRQ_WAKE_THREAD; 163 163 } 164 164 165 165 /**
+11 -9
drivers/staging/lustre/lustre/obdecho/echo_client.c
··· 1270 1270 echo_copyout_lsm(struct lov_stripe_md *lsm, void *_ulsm, int ulsm_nob) 1271 1271 { 1272 1272 struct lov_stripe_md *ulsm = _ulsm; 1273 + struct lov_oinfo **p; 1273 1274 int nob, i; 1274 1275 1275 1276 nob = offsetof(struct lov_stripe_md, lsm_oinfo[lsm->lsm_stripe_count]); ··· 1280 1279 if (copy_to_user(ulsm, lsm, sizeof(*ulsm))) 1281 1280 return -EFAULT; 1282 1281 1283 - for (i = 0; i < lsm->lsm_stripe_count; i++) { 1284 - if (copy_to_user(ulsm->lsm_oinfo[i], lsm->lsm_oinfo[i], 1285 - sizeof(lsm->lsm_oinfo[0]))) 1282 + for (i = 0, p = lsm->lsm_oinfo; i < lsm->lsm_stripe_count; i++, p++) { 1283 + struct lov_oinfo __user *up; 1284 + if (get_user(up, ulsm->lsm_oinfo + i) || 1285 + copy_to_user(up, *p, sizeof(struct lov_oinfo))) 1286 1286 return -EFAULT; 1287 1287 } 1288 1288 return 0; ··· 1291 1289 1292 1290 static int 1293 1291 echo_copyin_lsm(struct echo_device *ed, struct lov_stripe_md *lsm, 1294 - void *ulsm, int ulsm_nob) 1292 + struct lov_stripe_md __user *ulsm, int ulsm_nob) 1295 1293 { 1296 1294 struct echo_client_obd *ec = ed->ed_ec; 1295 + struct lov_oinfo **p; 1297 1296 int i; 1298 1297 1299 1298 if (ulsm_nob < sizeof(*lsm)) ··· 1309 1306 ((__u64)lsm->lsm_stripe_size * lsm->lsm_stripe_count > ~0UL)) 1310 1307 return -EINVAL; 1311 1308 1312 - for (i = 0; i < lsm->lsm_stripe_count; i++) { 1313 - if (copy_from_user(lsm->lsm_oinfo[i], 1314 - ((struct lov_stripe_md *)ulsm)-> \ 1315 - lsm_oinfo[i], 1316 - sizeof(lsm->lsm_oinfo[0]))) 1309 + for (i = 0, p = lsm->lsm_oinfo; i < lsm->lsm_stripe_count; i++, p++) { 1310 + struct lov_oinfo __user *up; 1311 + if (get_user(up, ulsm->lsm_oinfo + i) || 1312 + copy_from_user(*p, up, sizeof(struct lov_oinfo))) 1317 1313 return -EFAULT; 1318 1314 } 1319 1315 return 0;