Skip to content

Commit

Permalink
Merge tag 'char-misc-4.12-rc5' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/gregkh/char-misc

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
  • Loading branch information
torvalds committed Jun 11, 2017
2 parents 21c9eb7 + ed45509 commit 9cd9cb0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -5622,7 +5622,7 @@ F: scripts/get_maintainer.pl

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

Expand Down
2 changes: 1 addition & 1 deletion drivers/char/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/* 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;

if (!valid_mmap_phys_addr_range(vma->vm_pgoff, size))
Expand Down
8 changes: 4 additions & 4 deletions drivers/firmware/google/vpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ static int vpd_section_attrib_add(const u8 *key, s32 key_len,
info->value = value;

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

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

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

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

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

module_init(vpd_platform_init);
Expand Down
4 changes: 3 additions & 1 deletion drivers/misc/mei/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
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);

Expand Down
2 changes: 1 addition & 1 deletion drivers/platform/goldfish/goldfish_pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ static int get_free_pipe_id_locked(struct goldfish_pipe_dev *dev)
/* Reallocate the array */
u32 new_capacity = 2 * dev->pipes_capacity;
struct goldfish_pipe **pipes =
kcalloc(new_capacity, sizeof(*pipes), GFP_KERNEL);
kcalloc(new_capacity, sizeof(*pipes), GFP_ATOMIC);
if (!pipes)
return -ENOMEM;
memcpy(pipes, dev->pipes, sizeof(*pipes) * dev->pipes_capacity);
Expand Down

0 comments on commit 9cd9cb0

Please sign in to comment.