search for: err_enable_device

Displaying 20 results from an estimated 49 matches for "err_enable_device".

2017 Dec 14
4
[PATCH v2 1/3] virtio_pci: use put_device instead of kfree
...e(&vp_dev->vdev.dev); > + } > > - return 0; > + return rc; > > -err_register: > - if (vp_dev->ioaddr) > - virtio_pci_legacy_remove(vp_dev); > - else > - virtio_pci_modern_remove(vp_dev); > err_probe: > pci_disable_device(pci_dev); > err_enable_device: > -- > 2.9.4 I'd prefer something like the below. ---> virtio_pci: don't kfree device on register failure Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index 1c4797e..995a...
2017 Dec 14
4
[PATCH v2 1/3] virtio_pci: use put_device instead of kfree
...e(&vp_dev->vdev.dev); > + } > > - return 0; > + return rc; > > -err_register: > - if (vp_dev->ioaddr) > - virtio_pci_legacy_remove(vp_dev); > - else > - virtio_pci_modern_remove(vp_dev); > err_probe: > pci_disable_device(pci_dev); > err_enable_device: > -- > 2.9.4 I'd prefer something like the below. ---> virtio_pci: don't kfree device on register failure Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index 1c4797e..995a...
2015 Jun 24
1
[PATCH] virtio-pci: alloc only resources actually used.
...etions(-) diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index eba1b7a..327a121 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -510,10 +510,6 @@ static int virtio_pci_probe(struct pci_dev *pci_dev, if (rc) goto err_enable_device; - rc = pci_request_regions(pci_dev, "virtio-pci"); - if (rc) - goto err_request_regions; - if (force_legacy) { rc = virtio_pci_legacy_probe(vp_dev); /* Also try modern mode if we can't map BAR0 (no IO space). */ @@ -543,8 +539,6 @@ err_register: else virtio_pci_mo...
2015 Jun 24
1
[PATCH] virtio-pci: alloc only resources actually used.
...etions(-) diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index eba1b7a..327a121 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -510,10 +510,6 @@ static int virtio_pci_probe(struct pci_dev *pci_dev, if (rc) goto err_enable_device; - rc = pci_request_regions(pci_dev, "virtio-pci"); - if (rc) - goto err_request_regions; - if (force_legacy) { rc = virtio_pci_legacy_probe(vp_dev); /* Also try modern mode if we can't map BAR0 (no IO space). */ @@ -543,8 +539,6 @@ err_register: else virtio_pci_mo...
2015 Jun 23
1
[PATCH] virtio-pci: alloc only resources actually used.
...etions(-) diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index eba1b7a..327a121 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -510,10 +510,6 @@ static int virtio_pci_probe(struct pci_dev *pci_dev, if (rc) goto err_enable_device; - rc = pci_request_regions(pci_dev, "virtio-pci"); - if (rc) - goto err_request_regions; - if (force_legacy) { rc = virtio_pci_legacy_probe(vp_dev); /* Also try modern mode if we can't map BAR0 (no IO space). */ @@ -543,8 +539,6 @@ err_register: else virtio_pci_mo...
2015 Jun 23
1
[PATCH] virtio-pci: alloc only resources actually used.
...etions(-) diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index eba1b7a..327a121 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -510,10 +510,6 @@ static int virtio_pci_probe(struct pci_dev *pci_dev, if (rc) goto err_enable_device; - rc = pci_request_regions(pci_dev, "virtio-pci"); - if (rc) - goto err_request_regions; - if (force_legacy) { rc = virtio_pci_legacy_probe(vp_dev); /* Also try modern mode if we can't map BAR0 (no IO space). */ @@ -543,8 +539,6 @@ err_register: else virtio_pci_mo...
2015 Jun 16
2
[PATCH] virtio-pci: alloc only resources actually used.
...etions(-) diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index eba1b7a..327a121 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -510,10 +510,6 @@ static int virtio_pci_probe(struct pci_dev *pci_dev, if (rc) goto err_enable_device; - rc = pci_request_regions(pci_dev, "virtio-pci"); - if (rc) - goto err_request_regions; - if (force_legacy) { rc = virtio_pci_legacy_probe(vp_dev); /* Also try modern mode if we can't map BAR0 (no IO space). */ @@ -543,8 +539,6 @@ err_register: else virtio_pci_mo...
2015 Jun 16
2
[PATCH] virtio-pci: alloc only resources actually used.
...etions(-) diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index eba1b7a..327a121 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -510,10 +510,6 @@ static int virtio_pci_probe(struct pci_dev *pci_dev, if (rc) goto err_enable_device; - rc = pci_request_regions(pci_dev, "virtio-pci"); - if (rc) - goto err_request_regions; - if (force_legacy) { rc = virtio_pci_legacy_probe(vp_dev); /* Also try modern mode if we can't map BAR0 (no IO space). */ @@ -543,8 +539,6 @@ err_register: else virtio_pci_mo...
2017 Dec 12
1
[PATCH 1/3] virtio_pci: use put_device instead of kfree
...e(&vp_dev->vdev.dev); > + } > > - return 0; > + return rc; > > -err_register: > - if (vp_dev->ioaddr) > - virtio_pci_legacy_remove(vp_dev); > - else > - virtio_pci_modern_remove(vp_dev); > err_probe: > pci_disable_device(pci_dev); > err_enable_device: Otherwise, looks good. Reviewed-by: Cornelia Huck <cohuck at redhat.com>
2017 Dec 12
1
[PATCH 1/3] virtio_pci: use put_device instead of kfree
...e(&vp_dev->vdev.dev); > + } > > - return 0; > + return rc; > > -err_register: > - if (vp_dev->ioaddr) > - virtio_pci_legacy_remove(vp_dev); > - else > - virtio_pci_modern_remove(vp_dev); > err_probe: > pci_disable_device(pci_dev); > err_enable_device: Otherwise, looks good. Reviewed-by: Cornelia Huck <cohuck at redhat.com>
2016 Jan 14
1
[PATCH] virtio_pci: fix use after free on release
...; --- drivers/virtio/virtio_pci_common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index 36205c2..f6bed86 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -545,6 +545,7 @@ err_enable_device: static void virtio_pci_remove(struct pci_dev *pci_dev) { struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); + struct device *dev = get_device(&vp_dev->vdev.dev); unregister_virtio_device(&vp_dev->vdev); @@ -554,6 +555,7 @@ static void virtio_pci_remove(struct pci_...
2016 Jan 14
1
[PATCH] virtio_pci: fix use after free on release
...; --- drivers/virtio/virtio_pci_common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index 36205c2..f6bed86 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -545,6 +545,7 @@ err_enable_device: static void virtio_pci_remove(struct pci_dev *pci_dev) { struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); + struct device *dev = get_device(&vp_dev->vdev.dev); unregister_virtio_device(&vp_dev->vdev); @@ -554,6 +555,7 @@ static void virtio_pci_remove(struct pci_...
2015 Mar 25
2
[PATCH] Add virtio gpu driver.
...virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c > > index e894eb2..a3167fa 100644 > > --- a/drivers/virtio/virtio_pci_common.c > > +++ b/drivers/virtio/virtio_pci_common.c > > @@ -510,7 +510,7 @@ static int virtio_pci_probe(struct pci_dev *pci_dev, > > goto err_enable_device; > > > > rc = pci_request_regions(pci_dev, "virtio-pci"); > > - if (rc) > > + if (rc && ((pci_dev->class >> 8) != PCI_CLASS_DISPLAY_VGA)) > > goto err_request_regions; > > > > if (force_legacy) { > > This is prob...
2015 Mar 25
2
[PATCH] Add virtio gpu driver.
...virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c > > index e894eb2..a3167fa 100644 > > --- a/drivers/virtio/virtio_pci_common.c > > +++ b/drivers/virtio/virtio_pci_common.c > > @@ -510,7 +510,7 @@ static int virtio_pci_probe(struct pci_dev *pci_dev, > > goto err_enable_device; > > > > rc = pci_request_regions(pci_dev, "virtio-pci"); > > - if (rc) > > + if (rc && ((pci_dev->class >> 8) != PCI_CLASS_DISPLAY_VGA)) > > goto err_request_regions; > > > > if (force_legacy) { > > This is prob...
2017 Dec 12
5
[PATCH v2 0/3] fix cleanup for fail to register_virtio_device
This series fix the cleanup for the caller of register_virtio_device, the main work is use put_device instead of kfree. V1->V2: * virtio_pci: add comments for the reason use put_device * virtio vop: also use put_device in in _vop_remove_device() weiping zhang (3): virtio_pci: use put_device instead of kfree virtio: use put_device instead of kfree virtio: put reference count of
2017 Dec 15
0
[PATCH v2 1/3] virtio_pci: use put_device instead of kfree
...>> + return rc; >> >> -err_register: >> - if (vp_dev->ioaddr) >> - virtio_pci_legacy_remove(vp_dev); >> - else >> - virtio_pci_modern_remove(vp_dev); >> err_probe: >> pci_disable_device(pci_dev); >> err_enable_device: >> -- >> 2.9.4 > > I'd prefer something like the below. > > ---> > > virtio_pci: don't kfree device on register failure > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > > --- > > diff --git a/drivers/virtio/virtio_pci_comm...
2017 Dec 12
5
[PATCH v2 0/3] fix cleanup for fail to register_virtio_device
This series fix the cleanup for the caller of register_virtio_device, the main work is use put_device instead of kfree. V1->V2: * virtio_pci: add comments for the reason use put_device * virtio vop: also use put_device in in _vop_remove_device() weiping zhang (3): virtio_pci: use put_device instead of kfree virtio: use put_device instead of kfree virtio: put reference count of
2015 Jun 18
2
[PATCH v2] virtio-pci: alloc only resources actually used.
...etions(-) diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index eba1b7a..327a121 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -510,10 +510,6 @@ static int virtio_pci_probe(struct pci_dev *pci_dev, if (rc) goto err_enable_device; - rc = pci_request_regions(pci_dev, "virtio-pci"); - if (rc) - goto err_request_regions; - if (force_legacy) { rc = virtio_pci_legacy_probe(vp_dev); /* Also try modern mode if we can't map BAR0 (no IO space). */ @@ -543,8 +539,6 @@ err_register: else virtio_pci_mo...
2015 Jun 18
2
[PATCH v2] virtio-pci: alloc only resources actually used.
...etions(-) diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index eba1b7a..327a121 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -510,10 +510,6 @@ static int virtio_pci_probe(struct pci_dev *pci_dev, if (rc) goto err_enable_device; - rc = pci_request_regions(pci_dev, "virtio-pci"); - if (rc) - goto err_request_regions; - if (force_legacy) { rc = virtio_pci_legacy_probe(vp_dev); /* Also try modern mode if we can't map BAR0 (no IO space). */ @@ -543,8 +539,6 @@ err_register: else virtio_pci_mo...
2017 Dec 15
1
[PATCH v2 1/3] virtio_pci: use put_device instead of kfree
...>> -err_register: > >> - if (vp_dev->ioaddr) > >> - virtio_pci_legacy_remove(vp_dev); > >> - else > >> - virtio_pci_modern_remove(vp_dev); > >> err_probe: > >> pci_disable_device(pci_dev); > >> err_enable_device: > >> -- > >> 2.9.4 > > > > I'd prefer something like the below. > > > > ---> > > > > virtio_pci: don't kfree device on register failure > > > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > > > &g...