From: "Michael S. Tsirkin" <mst@redhat.com>
To: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: "Hans J. Koch" <hjk@hansjkoch.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
ldv-project@linuxtesting.org
Subject: Re: [PATCH] uio/uio_pci_generic: don't return zero on failure path in probe()
Date: Mon, 8 Dec 2014 09:29:00 +0200 [thread overview]
Message-ID: <20141208072900.GE18208@redhat.com> (raw)
In-Reply-To: <1417814881-4684-1-git-send-email-khoroshilov@ispras.ru>
On Sat, Dec 06, 2014 at 12:28:01AM +0300, Alexey Khoroshilov wrote:
> If uio_register_device() fails in probe(), it breaks off initialization,
> deallocates all resources, but returns zero.
>
> The patch adds proper error code propagation.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> drivers/uio/uio_pci_generic.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/uio/uio_pci_generic.c b/drivers/uio/uio_pci_generic.c
> index 077ae12269ce..d0b508b68f3c 100644
> --- a/drivers/uio/uio_pci_generic.c
> +++ b/drivers/uio/uio_pci_generic.c
> @@ -91,7 +91,8 @@ static int probe(struct pci_dev *pdev,
> gdev->info.handler = irqhandler;
> gdev->pdev = pdev;
>
> - if (uio_register_device(&pdev->dev, &gdev->info))
> + err = uio_register_device(&pdev->dev, &gdev->info);
> + if (err)
> goto err_register;
> pci_set_drvdata(pdev, gdev);
>
> --
> 1.9.1
prev parent reply other threads:[~2014-12-08 7:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-05 21:28 [PATCH] uio/uio_pci_generic: don't return zero on failure path in probe() Alexey Khoroshilov
2014-12-08 7:29 ` Michael S. Tsirkin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141208072900.GE18208@redhat.com \
--to=mst@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=hjk@hansjkoch.de \
--cc=khoroshilov@ispras.ru \
--cc=kvm@vger.kernel.org \
--cc=ldv-project@linuxtesting.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.