diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-01-26 18:28:36 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-01-26 18:28:36 +0300 |
commit | b8bc3bde9c8c90500c648627d53f846642ff8639 (patch) | |
tree | 0c3ed82848a25948206556bc699a10d30bd18d07 /drivers/block/cciss.c | |
parent | 171b5682aa8597174e80ec4128c87538103f2213 (diff) | |
parent | 9abc2a08a7d665b02bdde974fd6c44aae86e923e (diff) | |
download | linux-b8bc3bde9c8c90500c648627d53f846642ff8639.tar.xz |
Merge tag 'kvm-s390-master-4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD
KVM: s390: Fixes for kvm/master (targeting 4.5)
1. Fallout of some bigger floating point/vector rework in s390
- memory leak -> stable 4.3+
- memory overwrite -> stable 4.4+
2. enable KVM-VFIO for s390
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r-- | drivers/block/cciss.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 0422c47261c3..63c2064689f8 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -514,14 +514,9 @@ cciss_proc_write(struct file *file, const char __user *buf, if (!buf || length > PAGE_SIZE - 1) return -EINVAL; - buffer = (char *)__get_free_page(GFP_KERNEL); - if (!buffer) - return -ENOMEM; - - err = -EFAULT; - if (copy_from_user(buffer, buf, length)) - goto out; - buffer[length] = '\0'; + buffer = memdup_user_nul(buf, length); + if (IS_ERR(buffer)) + return PTR_ERR(buffer); #ifdef CONFIG_CISS_SCSI_TAPE if (strncmp(ENGAGE_SCSI, buffer, sizeof ENGAGE_SCSI - 1) == 0) { @@ -537,8 +532,7 @@ cciss_proc_write(struct file *file, const char __user *buf, /* might be nice to have "disengage" too, but it's not safely possible. (only 1 module use count, lock issues.) */ -out: - free_page((unsigned long)buffer); + kfree(buffer); return err; } @@ -3854,7 +3848,7 @@ static void print_cfg_table(ctlr_info_t *h) readl(&(tb->HostWrite.CoalIntDelay))); dev_dbg(&h->pdev->dev, " Coalesce Interrupt Count = 0x%x\n", readl(&(tb->HostWrite.CoalIntCount))); - dev_dbg(&h->pdev->dev, " Max outstanding commands = 0x%d\n", + dev_dbg(&h->pdev->dev, " Max outstanding commands = 0x%x\n", readl(&(tb->CmdsOutMax))); dev_dbg(&h->pdev->dev, " Bus Types = 0x%x\n", readl(&(tb->BusTypes))); |