mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: arvind Yadav <arvind.yadav.cs@gmail.com>
To: mirq-linux@rere.qmqm.pl
Cc: linux-kernel@vger.kernel.org
Subject: Re: [v1] misc: cb710: core:- Handle return NULL error from pcim_iomap_table
Date: Thu, 22 Dec 2016 22:44:03 +0530	[thread overview]
Message-ID: <f8a82727-b1bb-8c6f-4f0a-ec4fe3079a4d@gmail.com> (raw)
In-Reply-To: <1482407910-13295-1-git-send-email-arvind.yadav.cs@gmail.com>

Ignore this change. Sorry for the noise.

Thanks
Arvind


On Thursday 22 December 2016 05:28 PM, Arvind Yadav wrote:
> Here, If pcim_iomap_table will fail. It will return NULL.
> Kernel can run into a NULL-pointer dereference.
> This error check will avoid NULL pointer dereference.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
>   drivers/misc/cb710/core.c |    2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/misc/cb710/core.c b/drivers/misc/cb710/core.c
> index fb397e7..7b60019 100644
> --- a/drivers/misc/cb710/core.c
> +++ b/drivers/misc/cb710/core.c
> @@ -248,6 +248,8 @@ static int cb710_probe(struct pci_dev *pdev,
>   	spin_lock_init(&chip->irq_lock);
>   	chip->pdev = pdev;
>   	chip->iobase = pcim_iomap_table(pdev)[0];
> +	if (!chip->iobase)
> +		return -ENOMEM;
>   
>   	pci_set_drvdata(pdev, chip);
>   

      reply	other threads:[~2016-12-22 17:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-22 11:58 Arvind Yadav
2016-12-22 17:14 ` arvind Yadav [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=f8a82727-b1bb-8c6f-4f0a-ec4fe3079a4d@gmail.com \
    --to=arvind.yadav.cs@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mirq-linux@rere.qmqm.pl \
    /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

all inboxes | Powered by JetHome®