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;
+ }
+
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;
+ }
hp->CardP = (struct DpRam __iomem *) hp->Caddr;
hp->Type = RIO_PCI;
hp->Copy = rio_copy_to_card;
On Mon, 13 Aug 2007 00:05:30 -0400
"Scott Thompson" <[email protected]> wrote:
> 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..
Your mail client has wrapped the patches. Please resend without wrapping
On Mon, 13 Aug 2007 06:42:35 -0400 Alan Cox
<[email protected]> wrote:
>Your mail client has wrapped the patches. Please resend without
>wrapping
Much as I'd love to blame my mail client for this one...
Patch 4 of the 5 I sent was the only one with wrapping, and that
wrapping existed in abundance in /drivers/char/rio/rio_linux.c file
long before I got there. Several lines in that file exceed 100
columns, I think the "winner" was around 142.
I think tackling all the wordwrap issues would belong in a
different patch as I'm just trying to clean up ioremap usage. And,
yes, I contributed *one more* wordwrap issue to the file, but when
in Rome...
---------------------------------------
Scott Thompson / [email protected]
---------------------------------------
> Patch 4 of the 5 I sent was the only one with wrapping, and that
> wrapping existed in abundance in /drivers/char/rio/rio_linux.c file
> long before I got there. Several lines in that file exceed 100
> columns, I think the "winner" was around 142.
Thats not the issue - the patch itself appears to be wrapped and mangled
and is not suitable for application.
why [email protected]?
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 ([email protected])
Faculty of Informatics, Masaryk University
On Mon, 13 Aug 2007 16:30:14 -0400 Jiri Slaby <[email protected]>
wrote:
>why [email protected]?
>
David Airlie was listed as the owner on several of the files and in
maintainers for "DRM", which was my best to: guess for
/drivers/char/drm (which was patch 3 in this series).
If there was a better list, or just to linux-kernel, please let me
know as tracking down the 'right' list for these kernel-janitor
kind of tasks can be tricky....
---------------------------------------
Scott Thompson / [email protected]
---------------------------------------
Scott Thompson napsal(a):
> On Mon, 13 Aug 2007 16:30:14 -0400 Jiri Slaby <[email protected]>
> wrote:
>> why [email protected]?
>>
>
> David Airlie was listed as the owner on several of the files and in
> maintainers for "DRM", which was my best to: guess for
> /drivers/char/drm (which was patch 3 in this series).
>
> If there was a better list, or just to linux-kernel, please let me
> know as tracking down the 'right' list for these kernel-janitor
> kind of tasks can be tricky....
Ok. I was just curious, why did you CC drm people for char drivers changes.
BTW. is there anybody on janitors list, who collects all those patches and
forwards them upstream?
--
Jiri Slaby ([email protected])
Faculty of Informatics, Masaryk University
On Wed, 15 Aug 2007 15:38:23 -0400 Jiri Slaby <[email protected]>
wrote:
>Ok. I was just curious, why did you CC drm people for char drivers
>changes.
>
>BTW. is there anybody on janitors list, who collects all those
>patches and
>forwards them upstream?
>
The "MAINTAINERS" list claims that there are "several" maintainers
for the kernel-janitors submitted patches and the readme on
kerneljanitors.org (http://www.kerneljanitors.org/README) lists a
few folks. Copying the originating maintainer/list is recommended
in one of the kerneljanitor faqs. Some groups seem more receptive
to these kind of fixes than others, though they may just be more
active maintainers.
I don't know if anyone does or doesn't roll these up collectively,
maybe the list can advise...
---------------------------------------
Scott Thompson / [email protected]
---------------------------------------