2001-02-23 07:54:38

by Andrey Panin

[permalink] [raw]
Subject: [PATCH] drivers/char/serial.c unchecked ioremap() calls


Hi all,

16x50 serial driver doesn't check ioremap() return value.
Atached patch should fix this it.

Best regards.

--
Andrey Panin | Embedded systems software engineer
[email protected] | PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc


Attachments:
patch-ioremap-serial (1.04 kB)
(No filename) (232.00 B)
Download all attachments

2001-02-23 11:25:48

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH] drivers/char/serial.c unchecked ioremap() calls

Em Fri, Feb 23, 2001 at 10:53:59AM +0300, Andrey Panin escreveu:
>
> Hi all,
>
> 16x50 serial driver doesn't check ioremap() return value.
> Atached patch should fix this it.

humm, have not checked, but it seems as if you don't release the previous
successful mappings on failure. Wipe out this message if I was too quick to
answer and this is not true. 8)

- Arnaldo

2001-02-23 14:16:30

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH] drivers/char/serial.c unchecked ioremap() calls

Arnaldo Carvalho de Melo wrote:
>
> Em Fri, Feb 23, 2001 at 10:53:59AM +0300, Andrey Panin escreveu:
> >
> > Hi all,
> >
> > 16x50 serial driver doesn't check ioremap() return value.
> > Atached patch should fix this it.
>
> humm, have not checked, but it seems as if you don't release the previous
> successful mappings on failure. Wipe out this message if I was too quick to
> answer and this is not true. 8)

Also, the proper return from a failed ioremap is -ENOMEM, so I think
Andrey's serial.c patch should modify some functions to return a failure
code...

Jeff



--
Jeff Garzik | "You see, in this world there's two kinds of
Building 1024 | people, my friend: Those with loaded guns
MandrakeSoft | and those who dig. You dig." --Blondie

2001-02-26 15:10:40

by Andrey Panin

[permalink] [raw]
Subject: Re: [PATCH] drivers/char/serial.c unchecked ioremap() calls

On Fri, Feb 23, 2001 at 09:15:29AM -0500, Jeff Garzik wrote:
> Arnaldo Carvalho de Melo wrote:
> >
> > Em Fri, Feb 23, 2001 at 10:53:59AM +0300, Andrey Panin escreveu:
> > >
> > > Hi all,
> > >
> > > 16x50 serial driver doesn't check ioremap() return value.
> > > Atached patch should fix this it.
> >
> > humm, have not checked, but it seems as if you don't release the previous
> > successful mappings on failure. Wipe out this message if I was too quick to
> > answer and this is not true. 8)
>
> Also, the proper return from a failed ioremap is -ENOMEM, so I think
> Andrey's serial.c patch should modify some functions to return a failure
> code...
>

All these ioremap() failures are not fatal,
just fail to init one PCI/ISAPNP device or one serial port.
IMHO a warning message will be enough for them :)

--
Andrey Panin | Embedded systems software engineer
[email protected] | PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc


Attachments:
(No filename) (232.00 B)