From: Johannes Thumshirn <johannes.thumshirn@men.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Johannes Thumshirn <johannes.thumshirn@men.de>,
<linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [patch] mcb: request_mem_region() returns NULL on error
Date: Thu, 15 Jan 2015 08:18:01 +0100 [thread overview]
Message-ID: <20150115071800.GA26024@jtlinux> (raw)
In-Reply-To: <20150114210840.GG23203@mwanda>
On Thu, Jan 15, 2015 at 12:08:40AM +0300, Dan Carpenter wrote:
> The code here is checking for IS_ERR() when request_mem_region() only
> returns NULL on error and never an ERR_PTR.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/mcb/mcb-pci.c b/drivers/mcb/mcb-pci.c
> index 5e1bd5d..2d6524a 100644
> --- a/drivers/mcb/mcb-pci.c
> +++ b/drivers/mcb/mcb-pci.c
> @@ -56,9 +56,9 @@ static int mcb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>
> res = request_mem_region(priv->mapbase, CHAM_HEADER_SIZE,
> KBUILD_MODNAME);
> - if (IS_ERR(res)) {
> + if (!res) {
> dev_err(&pdev->dev, "Failed to request PCI memory\n");
> - ret = PTR_ERR(res);
> + ret = -EBUSY;
> goto err_start;
> }
>
Applied to mcb-next, thanks.
prev parent reply other threads:[~2015-01-15 7:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-14 21:08 [patch] mcb: request_mem_region() returns NULL on error Dan Carpenter
2015-01-15 7:18 ` Johannes Thumshirn [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=20150115071800.GA26024@jtlinux \
--to=johannes.thumshirn@men.de \
--cc=bhelgaas@google.com \
--cc=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox