[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f8a82727-b1bb-8c6f-4f0a-ec4fe3079a4d@gmail.com>
Date: Thu, 22 Dec 2016 22:44:03 +0530
From: arvind Yadav <arvind.yadav.cs@...il.com>
To: mirq-linux@...e.qmqm.pl
Cc: linux-kernel@...r.kernel.org
Subject: Re: [v1] misc: cb710: core:- Handle return NULL error from
pcim_iomap_table
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@...il.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);
>
Powered by blists - more mailing lists