Commit 36e584de authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-linus-4.17-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen fixes from Juergen Gross:

 - some fixes of kmalloc() flags

 - one fix of the xenbus driver

 - an update of the pv sound driver interface needed for a driver which
   will go through the sound tree

* tag 'for-linus-4.17-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  xen: xenbus_dev_frontend: Really return response string
  xen/sndif: Sync up with the canonical definition in Xen
  xen: xen-pciback: Replace GFP_ATOMIC with GFP_KERNEL in pcistub_reg_add
  xen: xen-pciback: Replace GFP_ATOMIC with GFP_KERNEL in xen_pcibk_config_quirks_init
  xen: xen-pciback: Replace GFP_ATOMIC with GFP_KERNEL in pcistub_device_alloc
  xen: xen-pciback: Replace GFP_ATOMIC with GFP_KERNEL in pcistub_init_device
  xen: xen-pciback: Replace GFP_ATOMIC with GFP_KERNEL in pcistub_probe
parents 854da238 ebf04f33
...@@ -95,7 +95,7 @@ int xen_pcibk_config_quirks_init(struct pci_dev *dev) ...@@ -95,7 +95,7 @@ int xen_pcibk_config_quirks_init(struct pci_dev *dev)
struct xen_pcibk_config_quirk *quirk; struct xen_pcibk_config_quirk *quirk;
int ret = 0; int ret = 0;
quirk = kzalloc(sizeof(*quirk), GFP_ATOMIC); quirk = kzalloc(sizeof(*quirk), GFP_KERNEL);
if (!quirk) { if (!quirk) {
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
......
...@@ -71,7 +71,7 @@ static struct pcistub_device *pcistub_device_alloc(struct pci_dev *dev) ...@@ -71,7 +71,7 @@ static struct pcistub_device *pcistub_device_alloc(struct pci_dev *dev)
dev_dbg(&dev->dev, "pcistub_device_alloc\n"); dev_dbg(&dev->dev, "pcistub_device_alloc\n");
psdev = kzalloc(sizeof(*psdev), GFP_ATOMIC); psdev = kzalloc(sizeof(*psdev), GFP_KERNEL);
if (!psdev) if (!psdev)
return NULL; return NULL;
...@@ -364,7 +364,7 @@ static int pcistub_init_device(struct pci_dev *dev) ...@@ -364,7 +364,7 @@ static int pcistub_init_device(struct pci_dev *dev)
* here and then to call kfree(pci_get_drvdata(psdev->dev)). * here and then to call kfree(pci_get_drvdata(psdev->dev)).
*/ */
dev_data = kzalloc(sizeof(*dev_data) + strlen(DRV_NAME "[]") dev_data = kzalloc(sizeof(*dev_data) + strlen(DRV_NAME "[]")
+ strlen(pci_name(dev)) + 1, GFP_ATOMIC); + strlen(pci_name(dev)) + 1, GFP_KERNEL);
if (!dev_data) { if (!dev_data) {
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
...@@ -577,7 +577,7 @@ static int pcistub_probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -577,7 +577,7 @@ static int pcistub_probe(struct pci_dev *dev, const struct pci_device_id *id)
} }
if (!match) { if (!match) {
pci_dev_id = kmalloc(sizeof(*pci_dev_id), GFP_ATOMIC); pci_dev_id = kmalloc(sizeof(*pci_dev_id), GFP_KERNEL);
if (!pci_dev_id) { if (!pci_dev_id) {
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
...@@ -1149,7 +1149,7 @@ static int pcistub_reg_add(int domain, int bus, int slot, int func, ...@@ -1149,7 +1149,7 @@ static int pcistub_reg_add(int domain, int bus, int slot, int func,
} }
dev = psdev->dev; dev = psdev->dev;
field = kzalloc(sizeof(*field), GFP_ATOMIC); field = kzalloc(sizeof(*field), GFP_KERNEL);
if (!field) { if (!field) {
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
......
...@@ -403,7 +403,7 @@ static int xenbus_command_reply(struct xenbus_file_priv *u, ...@@ -403,7 +403,7 @@ static int xenbus_command_reply(struct xenbus_file_priv *u,
{ {
struct { struct {
struct xsd_sockmsg hdr; struct xsd_sockmsg hdr;
const char body[16]; char body[16];
} msg; } msg;
int rc; int rc;
...@@ -412,6 +412,7 @@ static int xenbus_command_reply(struct xenbus_file_priv *u, ...@@ -412,6 +412,7 @@ static int xenbus_command_reply(struct xenbus_file_priv *u,
msg.hdr.len = strlen(reply) + 1; msg.hdr.len = strlen(reply) + 1;
if (msg.hdr.len > sizeof(msg.body)) if (msg.hdr.len > sizeof(msg.body))
return -E2BIG; return -E2BIG;
memcpy(&msg.body, reply, msg.hdr.len);
mutex_lock(&u->reply_mutex); mutex_lock(&u->reply_mutex);
rc = queue_reply(&u->read_buffers, &msg, sizeof(msg.hdr) + msg.hdr.len); rc = queue_reply(&u->read_buffers, &msg, sizeof(msg.hdr) + msg.hdr.len);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment