2004-09-01 17:24:15

by Dave Jones

[permalink] [raw]
Subject: [PATCH] Fix NULL dereference in OSS v_midi driver

Spotted with the source checker from Coverity.com.

Signed-off-by: Dave Jones <[email protected]>


diff -urpN --exclude-from=/home/davej/.exclude bk-linus/sound/oss/v_midi.c linux-2.6/sound/oss/v_midi.c
--- bk-linus/sound/oss/v_midi.c 2004-06-03 13:40:31.000000000 +0100
+++ linux-2.6/sound/oss/v_midi.c 2004-06-03 13:43:00.000000000 +0100
@@ -90,11 +90,12 @@ static void v_midi_close (int dev)
static int v_midi_out (int dev, unsigned char midi_byte)
{
vmidi_devc *devc = midi_devs[dev]->devc;
- vmidi_devc *pdevc = midi_devs[devc->pair_mididev]->devc;
+ vmidi_devc *pdevc;

if (devc == NULL)
- return -(ENXIO);
+ return -ENXIO;

+ pdevc = midi_devs[devc->pair_mididev]->devc;
if (pdevc->input_opened > 0){
if (MIDIbuf_avail(pdevc->my_mididev) > 500)
return 0;


2004-09-07 15:57:32

by Herbert Poetzl

[permalink] [raw]
Subject: Re: [PATCH] Fix NULL dereference in OSS v_midi driver

On Wed, Sep 01, 2004 at 04:51:23PM +0100, Dave Jones wrote:
> Spotted with the source checker from Coverity.com.

apologies for the OT question:

how do you get the code checked with the source code
checker from Coverity.com?

and would it be possible to have other kernel branches
or specific kernel patches checked too?

TIA,
Herbert

2004-09-08 23:19:03

by Dave Jones

[permalink] [raw]
Subject: Re: [PATCH] Fix NULL dereference in OSS v_midi driver

On Tue, Sep 07, 2004 at 05:52:40PM +0200, Herbert Poetzl wrote:
> On Wed, Sep 01, 2004 at 04:51:23PM +0100, Dave Jones wrote:
> > Spotted with the source checker from Coverity.com.
>
> apologies for the OT question:
>
> how do you get the code checked with the source code
> checker from Coverity.com?

AFAIK, the current results are run on a vanilla 2.6.4 tree.

> and would it be possible to have other kernel branches
> or specific kernel patches checked too?

I've asked them if they'd rerun the tests on something more
recent a few times, but they've other more important things
to do it seems.

Dave