public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: postfail@hushmail.com
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	dri-devel@lists.sourceforge.net
Subject: Re: [PATCH 4 of 5 ] /drivers/char/rio ioremap balancing/ returncode check
Date: Mon, 13 Aug 2007 22:30:14 +0200	[thread overview]
Message-ID: <46C0BF56.7000308@gmail.com> (raw)
In-Reply-To: <20070813040530.9E0E9DA82E@mailserver8.hushmail.com>

why dri-devel@lists.sourceforge.net?

Scott Thompson napsal(a):
> patchset against 2.6.23-rc2 and this set is an audit of 
> /drivers/char/a* 
> through drivers/char .   
> 
> this corrects missing ioremap return checks and balancing on 
> iounmap calls..
> 
> Signed-off-by: Scott Thompson <postfail <at> hushmail.com>
> ----------------------------------------------------------
> diff --git a/drivers/char/rio/rio_linux.c 
> b/drivers/char/rio/rio_linux.c
> index 0ce9667..fdaf44f 100644
> --- a/drivers/char/rio/rio_linux.c
> +++ b/drivers/char/rio/rio_linux.c
> @@ -924,6 +924,11 @@ static void fix_rio_pci(struct pci_dev *pdev)
>  
>  	hwbase = pci_resource_start(pdev, 0);
>  	rebase = ioremap(hwbase, 0x80);
> +	if (!rebase) {
> +		printk(KERN_DEBUG "rio: unable to perform cntrl reg fix as 
> ioremap call failed\n");
> +		return;
> +	}
> +		
>  	t = readl(rebase + CNTRL_REG_OFFSET);
>  	if (t != CNTRL_REG_GOODVALUE) {
>  		printk(KERN_DEBUG "rio: performing cntrl reg fix: %08x -> 
> %08x\n", t, CNTRL_REG_GOODVALUE);
> @@ -996,6 +1001,11 @@ static int __init rio_init(void)
>  		if (((1 << hp->Ivec) & rio_irqmask) == 0)
>  			hp->Ivec = 0;
>  		hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, 
> RIO_WINDOW_LEN);
> +		if (!hp->Caddr) {
> +			printk(KERN_ERR "RIO: Unable to ioremap.\n");
> +			return -ENOMEM;
> +		}

hmm, and what about the yet inited cards here?

> +
>  		hp->CardP = (struct DpRam __iomem *) hp->Caddr;
>  		hp->Type = RIO_PCI;
>  		hp->Copy = rio_copy_to_card;
> @@ -1049,6 +1059,10 @@ static int __init rio_init(void)
>  			hp->Ivec = 0;
>  		hp->Ivec |= 0x8000;	/* Mark as non-sharable */
>  		hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, 
> RIO_WINDOW_LEN);
> +		if (!hp->Caddr) {
> +			printk(KERN_ERR "RIO: Unable to ioremap.\n");
> +			return -ENOMEM;
> +		}

And here.

>  		hp->CardP = (struct DpRam __iomem *) hp->Caddr;
>  		hp->Type = RIO_PCI;
>  		hp->Copy = rio_copy_to_card;

And what about the one on the line 1093?

-- 
Jiri Slaby (jirislaby@gmail.com)
Faculty of Informatics, Masaryk University

  parent reply	other threads:[~2007-08-13 20:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-13  4:05 [PATCH 4 of 5 ] /drivers/char/rio ioremap balancing/ returncode check Scott Thompson
2007-08-13 10:42 ` Alan Cox
2007-08-13 20:30 ` Jiri Slaby [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-08-13 12:50 Scott Thompson
2007-08-13 13:21 ` Alan Cox
2007-08-14  4:01 Scott Thompson
2007-08-15 19:38 ` Jiri Slaby
2007-08-15 19:52 Scott Thompson

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=46C0BF56.7000308@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=postfail@hushmail.com \
    /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