2007-10-22 02:47:30

by Adrian Bunk

[permalink] [raw]
Subject: char/cyclades.c: inconsequent NULL checking

The Coverity checker spotted the following inconsequent NULL checking in
drivers/char/cyclades.c:

<-- snip -->

...
static void cyz_handle_tx(struct cyclades_port *info,
struct BUF_CTRL __iomem *buf_ctrl)
{
struct cyclades_card *cinfo = info->card;
struct tty_struct *tty = info->tty;
...
if (tty == NULL)
goto ztxdone;
...
tty_wakeup(tty);
...

<-- snip -->

Nothing in cyz_handle_tx() seems to change "tty".

The "tty_wakeup(tty);" was added in commit
ebafeeff0fea029099e9952f233e0794106897a6.

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed


2007-10-22 19:06:34

by Jiri Slaby

[permalink] [raw]
Subject: Re: char/cyclades.c: inconsequent NULL checking

On 10/22/2007 04:47 AM, Adrian Bunk wrote:
> The Coverity checker spotted the following inconsequent NULL checking in

Where can one obtain such a checker?

> drivers/char/cyclades.c:
>
> <-- snip -->
>
> ...
> static void cyz_handle_tx(struct cyclades_port *info,
> struct BUF_CTRL __iomem *buf_ctrl)
> {
> struct cyclades_card *cinfo = info->card;
> struct tty_struct *tty = info->tty;
> ...
> if (tty == NULL)
> goto ztxdone;
> ...
> tty_wakeup(tty);
> ...
>
> <-- snip -->

patch on route, thanks,
--
Jiri Slaby ([email protected])
Faculty of Informatics, Masaryk University

2007-10-22 19:13:34

by Jiri Kosina

[permalink] [raw]
Subject: Re: char/cyclades.c: inconsequent NULL checking

On Mon, 22 Oct 2007, Jiri Slaby wrote:

> > The Coverity checker spotted the following inconsequent NULL checking in
> Where can one obtain such a checker?

That's a commercial proprietary thingie.

http://www.coverity.com/

--
Jiri Kosina

2007-10-22 19:41:40

by Adrian Bunk

[permalink] [raw]
Subject: Re: char/cyclades.c: inconsequent NULL checking

On Mon, Oct 22, 2007 at 09:12:23PM +0200, Jiri Kosina wrote:
> On Mon, 22 Oct 2007, Jiri Slaby wrote:
>
> > > The Coverity checker spotted the following inconsequent NULL checking in
> > Where can one obtain such a checker?
>
> That's a commercial proprietary thingie.
>
> http://www.coverity.com/

A bit more of background:

The US Department of Homeland Security pays them some money for scanning
open source projects, the Linux kernel is one of these projects, and
kernel developers can therefore get access to the database with the
results from their regular scans of Linus' tree.

I'm not a fan of proprietary software, but I'm simply considering their
results as bug reports that are worth looking at.

> Jiri Kosina

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed