Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9cd9cb0b authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull char/misc driver fixes from Greg KH:
 "Here are some small driver fixes for 4.12-rc5. Nothing major here,
  just some small bugfixes found by people testing, and a MAINTAINERS
  file update for the genwqe driver.

  All have been in linux-next with no reported issues"

[ The cxl driver fix came in through the powerpc tree earlier ]

* tag 'char-misc-4.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  cxl: Avoid double free_irq() for psl,slice interrupts
  mei: make sysfs modalias format similar as uevent modalias
  drivers: char: mem: Fix wraparound check to allow mappings up to the end
  MAINTAINERS: Change maintainer of genwqe driver
  goldfish_pipe: use GFP_ATOMIC under spin lock
  firmware: vpd: do not leak kobjects
  firmware: vpd: avoid potential use-after-free when destroying section
  firmware: vpd: do not leave freed section attributes to the list
parents 21c9eb7c ed45509b
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -5622,7 +5622,7 @@ F: scripts/get_maintainer.pl


GENWQE (IBM Generic Workqueue Card)
GENWQE (IBM Generic Workqueue Card)
M:	Frank Haverkamp <haver@linux.vnet.ibm.com>
M:	Frank Haverkamp <haver@linux.vnet.ibm.com>
M:	Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
M:	Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
S:	Supported
S:	Supported
F:	drivers/misc/genwqe/
F:	drivers/misc/genwqe/


+1 −1
Original line number Original line Diff line number Diff line
@@ -343,7 +343,7 @@ static int mmap_mem(struct file *file, struct vm_area_struct *vma)
	phys_addr_t offset = (phys_addr_t)vma->vm_pgoff << PAGE_SHIFT;
	phys_addr_t offset = (phys_addr_t)vma->vm_pgoff << PAGE_SHIFT;


	/* It's illegal to wrap around the end of the physical address space. */
	/* It's illegal to wrap around the end of the physical address space. */
	if (offset + (phys_addr_t)size < offset)
	if (offset + (phys_addr_t)size - 1 < offset)
		return -EINVAL;
		return -EINVAL;


	if (!valid_mmap_phys_addr_range(vma->vm_pgoff, size))
	if (!valid_mmap_phys_addr_range(vma->vm_pgoff, size))
+4 −4
Original line number Original line Diff line number Diff line
@@ -136,12 +136,12 @@ static int vpd_section_attrib_add(const u8 *key, s32 key_len,
	info->value = value;
	info->value = value;


	INIT_LIST_HEAD(&info->list);
	INIT_LIST_HEAD(&info->list);
	list_add_tail(&info->list, &sec->attribs);


	ret = sysfs_create_bin_file(sec->kobj, &info->bin_attr);
	ret = sysfs_create_bin_file(sec->kobj, &info->bin_attr);
	if (ret)
	if (ret)
		goto free_info_key;
		goto free_info_key;


	list_add_tail(&info->list, &sec->attribs);
	return 0;
	return 0;


free_info_key:
free_info_key:
@@ -158,8 +158,8 @@ static void vpd_section_attrib_destroy(struct vpd_section *sec)
	struct vpd_attrib_info *temp;
	struct vpd_attrib_info *temp;


	list_for_each_entry_safe(info, temp, &sec->attribs, list) {
	list_for_each_entry_safe(info, temp, &sec->attribs, list) {
		kfree(info->key);
		sysfs_remove_bin_file(sec->kobj, &info->bin_attr);
		sysfs_remove_bin_file(sec->kobj, &info->bin_attr);
		kfree(info->key);
		kfree(info);
		kfree(info);
	}
	}
}
}
@@ -244,7 +244,7 @@ static int vpd_section_destroy(struct vpd_section *sec)
{
{
	if (sec->enabled) {
	if (sec->enabled) {
		vpd_section_attrib_destroy(sec);
		vpd_section_attrib_destroy(sec);
		kobject_del(sec->kobj);
		kobject_put(sec->kobj);
		sysfs_remove_bin_file(vpd_kobj, &sec->bin_attr);
		sysfs_remove_bin_file(vpd_kobj, &sec->bin_attr);
		kfree(sec->raw_name);
		kfree(sec->raw_name);
		iounmap(sec->baseaddr);
		iounmap(sec->baseaddr);
@@ -331,7 +331,7 @@ static void __exit vpd_platform_exit(void)
{
{
	vpd_section_destroy(&ro_vpd);
	vpd_section_destroy(&ro_vpd);
	vpd_section_destroy(&rw_vpd);
	vpd_section_destroy(&rw_vpd);
	kobject_del(vpd_kobj);
	kobject_put(vpd_kobj);
}
}


module_init(vpd_platform_init);
module_init(vpd_platform_init);
+3 −1
Original line number Original line Diff line number Diff line
@@ -763,8 +763,10 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *a,
{
{
	struct mei_cl_device *cldev = to_mei_cl_device(dev);
	struct mei_cl_device *cldev = to_mei_cl_device(dev);
	const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl);
	const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl);
	u8 version = mei_me_cl_ver(cldev->me_cl);


	return scnprintf(buf, PAGE_SIZE, "mei:%s:%pUl:", cldev->name, uuid);
	return scnprintf(buf, PAGE_SIZE, "mei:%s:%pUl:%02X:",
			 cldev->name, uuid, version);
}
}
static DEVICE_ATTR_RO(modalias);
static DEVICE_ATTR_RO(modalias);


+1 −1
Original line number Original line Diff line number Diff line
@@ -704,7 +704,7 @@ static int get_free_pipe_id_locked(struct goldfish_pipe_dev *dev)
		/* Reallocate the array */
		/* Reallocate the array */
		u32 new_capacity = 2 * dev->pipes_capacity;
		u32 new_capacity = 2 * dev->pipes_capacity;
		struct goldfish_pipe **pipes =
		struct goldfish_pipe **pipes =
			kcalloc(new_capacity, sizeof(*pipes), GFP_KERNEL);
			kcalloc(new_capacity, sizeof(*pipes), GFP_ATOMIC);
		if (!pipes)
		if (!pipes)
			return -ENOMEM;
			return -ENOMEM;
		memcpy(pipes, dev->pipes, sizeof(*pipes) * dev->pipes_capacity);
		memcpy(pipes, dev->pipes, sizeof(*pipes) * dev->pipes_capacity);