lkml.org 
[lkml]   [2019]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] xen/pciback: Prevent NULL pointer dereference in quirks_show
Date
From: Uwe Dannowski <uwed@amazon.de>

Reading /sys/bus/pci/drivers/pciback/quirks while unbinding can result
in dereferencing a NULL pointer. Instead, skip printing information
about the dangling quirk.

Reported-by: Conny Seidel <consei@amazon.de>
Signed-off-by: Uwe Dannowski <uwed@amazon.de>
Signed-off-by: Stefan Nuernberger <snu@amazon.com>

Cc: xen-devel@lists.xenproject.org
Cc: stable@vger.kernel.org
---
drivers/xen/xen-pciback/pci_stub.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
index 097410a7cdb7..da725e474294 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -1346,6 +1346,8 @@ static ssize_t quirks_show(struct device_driver *drv, char *buf)
quirk->devid.subdevice);

dev_data = pci_get_drvdata(quirk->pdev);
+ if (!dev_data)
+ continue;

list_for_each_entry(cfg_entry, &dev_data->config_fields, list) {
field = cfg_entry->field;
--
2.23.0



Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Ralf Herbrich
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879



\
 
 \ /
  Last update: 2019-12-06 14:49    [W:0.043 / U:1.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site