linux-next: manual merge of the char-misc tree with the char-misc.current tree

Mark Brown posted 1 patch 4 days, 10 hours ago
linux-next: manual merge of the char-misc tree with the char-misc.current tree
Posted by Mark Brown 4 days, 10 hours ago
Hi all,

Today's linux-next merge of the char-misc tree got a conflict in:

  drivers/misc/nsm.c

between commit:

  ce1fed11d18e1 ("misc: nsm: only unlock nsm_dev on post-lock error paths")

from the char-misc.current tree and commit:

  937cd823bb2c9 ("misc: nsm: do not unlock mutex before locking it")

from the char-misc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --combined drivers/misc/nsm.c
index 3960506eb7ab3,bb254ee65b840..0000000000000
--- a/drivers/misc/nsm.c
+++ b/drivers/misc/nsm.c
@@@ -243,7 -243,7 +243,7 @@@ static int nsm_sendrecv_msg_locked(stru
  		goto cleanup;
  	}
  
- 	msg->resp.len = len;
+ 	msg->resp.len = min_t(unsigned int, len, sizeof(msg->resp.data));
  
  	rc = 0;
  
@@@ -365,9 -365,8 +365,8 @@@ static long nsm_dev_ioctl(struct file *
  		return -EINVAL;
  
  	/* Copy user argument struct to kernel argument struct */
- 	r = -EFAULT;
  	if (copy_from_user(&raw, argp, _IOC_SIZE(cmd)))
- 		return r;
+ 		return -EFAULT;
  
  	mutex_lock(&nsm->lock);
  
@@@ -413,7 -412,6 +412,7 @@@ static int nsm_device_init_vq(struct vi
  }
  
  static const struct file_operations nsm_dev_fops = {
 +	.owner = THIS_MODULE,
  	.unlocked_ioctl = nsm_dev_ioctl,
  	.compat_ioctl = compat_ptr_ioctl,
  };