Skip to content

Commit 36e584d

Browse files
committed
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
2 parents 854da23 + ebf04f3 commit 36e584d

File tree

4 files changed

+313
-22
lines changed

4 files changed

+313
-22
lines changed

drivers/xen/xen-pciback/conf_space_quirks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ int xen_pcibk_config_quirks_init(struct pci_dev *dev)
9595
struct xen_pcibk_config_quirk *quirk;
9696
int ret = 0;
9797

98-
quirk = kzalloc(sizeof(*quirk), GFP_ATOMIC);
98+
quirk = kzalloc(sizeof(*quirk), GFP_KERNEL);
9999
if (!quirk) {
100100
ret = -ENOMEM;
101101
goto out;

drivers/xen/xen-pciback/pci_stub.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static struct pcistub_device *pcistub_device_alloc(struct pci_dev *dev)
7171

7272
dev_dbg(&dev->dev, "pcistub_device_alloc\n");
7373

74-
psdev = kzalloc(sizeof(*psdev), GFP_ATOMIC);
74+
psdev = kzalloc(sizeof(*psdev), GFP_KERNEL);
7575
if (!psdev)
7676
return NULL;
7777

@@ -364,7 +364,7 @@ static int pcistub_init_device(struct pci_dev *dev)
364364
* here and then to call kfree(pci_get_drvdata(psdev->dev)).
365365
*/
366366
dev_data = kzalloc(sizeof(*dev_data) + strlen(DRV_NAME "[]")
367-
+ strlen(pci_name(dev)) + 1, GFP_ATOMIC);
367+
+ strlen(pci_name(dev)) + 1, GFP_KERNEL);
368368
if (!dev_data) {
369369
err = -ENOMEM;
370370
goto out;
@@ -577,7 +577,7 @@ static int pcistub_probe(struct pci_dev *dev, const struct pci_device_id *id)
577577
}
578578

579579
if (!match) {
580-
pci_dev_id = kmalloc(sizeof(*pci_dev_id), GFP_ATOMIC);
580+
pci_dev_id = kmalloc(sizeof(*pci_dev_id), GFP_KERNEL);
581581
if (!pci_dev_id) {
582582
err = -ENOMEM;
583583
goto out;
@@ -1149,7 +1149,7 @@ static int pcistub_reg_add(int domain, int bus, int slot, int func,
11491149
}
11501150
dev = psdev->dev;
11511151

1152-
field = kzalloc(sizeof(*field), GFP_ATOMIC);
1152+
field = kzalloc(sizeof(*field), GFP_KERNEL);
11531153
if (!field) {
11541154
err = -ENOMEM;
11551155
goto out;

drivers/xen/xenbus/xenbus_dev_frontend.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ static int xenbus_command_reply(struct xenbus_file_priv *u,
403403
{
404404
struct {
405405
struct xsd_sockmsg hdr;
406-
const char body[16];
406+
char body[16];
407407
} msg;
408408
int rc;
409409

@@ -412,6 +412,7 @@ static int xenbus_command_reply(struct xenbus_file_priv *u,
412412
msg.hdr.len = strlen(reply) + 1;
413413
if (msg.hdr.len > sizeof(msg.body))
414414
return -E2BIG;
415+
memcpy(&msg.body, reply, msg.hdr.len);
415416

416417
mutex_lock(&u->reply_mutex);
417418
rc = queue_reply(&u->read_buffers, &msg, sizeof(msg.hdr) + msg.hdr.len);

0 commit comments

Comments
 (0)