Skip to contentSkip to conversation

char/cyclades.c: inconsequent NULL checking

DISCUSSION Adrian Bunk 3 participants 4 messages Oct 22, 2007

lore
Share & tools
lore
#0 lore raw

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

Signature · 4 lines
       "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
#1 lore raw
Quoted 1 line · Adrian Bunk

The Coverity checker spotted the following inconsequent NULL checking in

Where can one obtain such a checker?

Quoted 15 lines

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);
Quoted 3 lines

...

<-- snip -->

patch on route, thanks,

Signature · 2 lines
Jiri Slaby ([email protected])
Faculty of Informatics, Masaryk University
#2 lore raw
Quoted 2 lines · Jiri Slaby
Quoted 1 line

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/

Signature · 1 line
Jiri Kosina
#3 lore raw
Quoted 8 lines · Jiri Kosina
Quoted 2 lines · Jiri Slaby
Quoted 1 line

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.

Quoted 1 line

Jiri Kosina

cu
Adrian

Signature · 4 lines
       "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