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.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging fixes from Greg KH:
"Here are three staging driver fixes for 4.16-rc6

Two of them are lockdep fixes for the ashmem driver that have been
reported by a number of people recently. The last one is a fix for the
comedi driver core.

All of these have been in linux-next for a while with no reported
issues"

* tag 'staging-4.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
staging: android: ashmem: Fix possible deadlock in ashmem_ioctl
staging: comedi: fix comedi_nsamples_left.
staging: android: ashmem: Fix lockdep issue during llseek

+11 -15
+10 -13
drivers/staging/android/ashmem.c
··· 326 326 mutex_lock(&ashmem_mutex); 327 327 328 328 if (asma->size == 0) { 329 - ret = -EINVAL; 330 - goto out; 329 + mutex_unlock(&ashmem_mutex); 330 + return -EINVAL; 331 331 } 332 332 333 333 if (!asma->file) { 334 - ret = -EBADF; 335 - goto out; 334 + mutex_unlock(&ashmem_mutex); 335 + return -EBADF; 336 336 } 337 + 338 + mutex_unlock(&ashmem_mutex); 337 339 338 340 ret = vfs_llseek(asma->file, offset, origin); 339 341 if (ret < 0) 340 - goto out; 342 + return ret; 341 343 342 344 /** Copy f_pos from backing file, since f_ops->llseek() sets it */ 343 345 file->f_pos = asma->file->f_pos; 344 - 345 - out: 346 - mutex_unlock(&ashmem_mutex); 347 346 return ret; 348 347 } 349 348 ··· 701 702 size_t pgstart, pgend; 702 703 int ret = -EINVAL; 703 704 705 + if (unlikely(copy_from_user(&pin, p, sizeof(pin)))) 706 + return -EFAULT; 707 + 704 708 mutex_lock(&ashmem_mutex); 705 709 706 710 if (unlikely(!asma->file)) 707 711 goto out_unlock; 708 - 709 - if (unlikely(copy_from_user(&pin, p, sizeof(pin)))) { 710 - ret = -EFAULT; 711 - goto out_unlock; 712 - } 713 712 714 713 /* per custom, you can pass zero for len to mean "everything onward" */ 715 714 if (!pin.len)
+1 -2
drivers/staging/comedi/drivers.c
··· 475 475 struct comedi_cmd *cmd = &async->cmd; 476 476 477 477 if (cmd->stop_src == TRIG_COUNT) { 478 - unsigned int nscans = nsamples / cmd->scan_end_arg; 479 - unsigned int scans_left = __comedi_nscans_left(s, nscans); 478 + unsigned int scans_left = __comedi_nscans_left(s, cmd->stop_arg); 480 479 unsigned int scan_pos = 481 480 comedi_bytes_to_samples(s, async->scan_progress); 482 481 unsigned long long samples_left = 0;