* [PATCH] mcb: Do not return zero on error path in mcb_pci_probe()
@ 2015-10-17 21:33 Alexey Khoroshilov
2015-10-22 7:28 ` Johannes Thumshirn
0 siblings, 1 reply; 3+ messages in thread
From: Alexey Khoroshilov @ 2015-10-17 21:33 UTC (permalink / raw)
To: Johannes Thumshirn
Cc: Alexey Khoroshilov, Greg Kroah-Hartman, linux-kernel, ldv-project
There is an error path in mcb_pci_probe() where
it returns zero instead of error code.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
drivers/mcb/mcb-pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mcb/mcb-pci.c b/drivers/mcb/mcb-pci.c
index 051645498b53..67d5e7d08df6 100644
--- a/drivers/mcb/mcb-pci.c
+++ b/drivers/mcb/mcb-pci.c
@@ -51,6 +51,7 @@ static int mcb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
priv->mapbase = pci_resource_start(pdev, 0);
if (!priv->mapbase) {
dev_err(&pdev->dev, "No PCI resource\n");
+ ret = -ENODEV;
goto out_disable;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mcb: Do not return zero on error path in mcb_pci_probe()
2015-10-17 21:33 [PATCH] mcb: Do not return zero on error path in mcb_pci_probe() Alexey Khoroshilov
@ 2015-10-22 7:28 ` Johannes Thumshirn
2015-11-02 3:15 ` Greg Kroah-Hartman
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Thumshirn @ 2015-10-22 7:28 UTC (permalink / raw)
To: Alexey Khoroshilov; +Cc: Greg Kroah-Hartman, linux-kernel, ldv-project
On Sat, Oct 17, 2015 at 11:33 PM, Alexey Khoroshilov
<khoroshilov@ispras.ru> wrote:
> There is an error path in mcb_pci_probe() where
> it returns zero instead of error code.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
> ---
> drivers/mcb/mcb-pci.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mcb/mcb-pci.c b/drivers/mcb/mcb-pci.c
> index 051645498b53..67d5e7d08df6 100644
> --- a/drivers/mcb/mcb-pci.c
> +++ b/drivers/mcb/mcb-pci.c
> @@ -51,6 +51,7 @@ static int mcb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> priv->mapbase = pci_resource_start(pdev, 0);
> if (!priv->mapbase) {
> dev_err(&pdev->dev, "No PCI resource\n");
> + ret = -ENODEV;
> goto out_disable;
> }
>
> --
> 1.9.1
>
Applied, thanks.
@Greg, shall I forward you the patch or do a pull request?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mcb: Do not return zero on error path in mcb_pci_probe()
2015-10-22 7:28 ` Johannes Thumshirn
@ 2015-11-02 3:15 ` Greg Kroah-Hartman
0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2015-11-02 3:15 UTC (permalink / raw)
To: Johannes Thumshirn; +Cc: Alexey Khoroshilov, linux-kernel, ldv-project
On Thu, Oct 22, 2015 at 09:28:57AM +0200, Johannes Thumshirn wrote:
> On Sat, Oct 17, 2015 at 11:33 PM, Alexey Khoroshilov
> <khoroshilov@ispras.ru> wrote:
> > There is an error path in mcb_pci_probe() where
> > it returns zero instead of error code.
> >
> > Found by Linux Driver Verification project (linuxtesting.org).
> >
> > Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
> > ---
> > drivers/mcb/mcb-pci.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/mcb/mcb-pci.c b/drivers/mcb/mcb-pci.c
> > index 051645498b53..67d5e7d08df6 100644
> > --- a/drivers/mcb/mcb-pci.c
> > +++ b/drivers/mcb/mcb-pci.c
> > @@ -51,6 +51,7 @@ static int mcb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> > priv->mapbase = pci_resource_start(pdev, 0);
> > if (!priv->mapbase) {
> > dev_err(&pdev->dev, "No PCI resource\n");
> > + ret = -ENODEV;
> > goto out_disable;
> > }
> >
> > --
> > 1.9.1
> >
>
> Applied, thanks.
>
> @Greg, shall I forward you the patch or do a pull request?
Please forward on, I don't do many pull requests.
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-11-02 3:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-17 21:33 [PATCH] mcb: Do not return zero on error path in mcb_pci_probe() Alexey Khoroshilov
2015-10-22 7:28 ` Johannes Thumshirn
2015-11-02 3:15 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox