All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: ALSA: firewire-lib: schedule work again when MIDI substream has rest of MIDI messages
@ 2015-10-15  7:04 Dan Carpenter
  2015-10-15  8:18 ` Takashi Sakamoto
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-10-15  7:04 UTC (permalink / raw)
  To: o-takashi; +Cc: alsa-devel

Hello Takashi Sakamoto,

This is a semi-automatic email about new static checker warnings.

The patch e8a40d9bcb23: "ALSA: firewire-lib: schedule work again when 
MIDI substream has rest of MIDI messages" from Oct 9, 2015, leads to 
the following Smatch complaint:

sound/firewire/lib.c:88 async_midi_port_callback()
	 error: we previously assumed 'substream' could be null (see line 77)

sound/firewire/lib.c
    76	
    77		if (rcode == RCODE_COMPLETE && substream != NULL)
                                               ^^^^^^^^^^^^^^^^^
Existing code assumes substream can be NULL.

    78			snd_rawmidi_transmit_ack(substream, port->consume_bytes);
    79		else if (!rcode_is_permanent_error(rcode))
    80			/* To start next transaction immediately for recovery. */
    81			port->next_ktime = ktime_set(0, 0);
    82		else
    83			/* Don't continue processing. */
    84			port->error = true;
    85	
    86		port->idling = true;
    87	
    88		if (!snd_rawmidi_transmit_empty(substream))
                                                ^^^^^^^^^
Patch adds an unchecked dereference (inside the function call).

    89			schedule_work(&port->work);
    90	}

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ALSA: firewire-lib: schedule work again when MIDI substream has rest of MIDI messages
  2015-10-15  7:04 ALSA: firewire-lib: schedule work again when MIDI substream has rest of MIDI messages Dan Carpenter
@ 2015-10-15  8:18 ` Takashi Sakamoto
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Sakamoto @ 2015-10-15  8:18 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: alsa-devel

Hi,

On Oct 15 2015 16:04, Dan Carpenter wrote:
> Hello Takashi Sakamoto,
>
> This is a semi-automatic email about new static checker warnings.
>
> The patch e8a40d9bcb23: "ALSA: firewire-lib: schedule work again when
> MIDI substream has rest of MIDI messages" from Oct 9, 2015, leads to
> the following Smatch complaint:
>
> sound/firewire/lib.c:88 async_midi_port_callback()
> 	 error: we previously assumed 'substream' could be null (see line 77)
>
> sound/firewire/lib.c
>      76	
>      77		if (rcode == RCODE_COMPLETE && substream != NULL)
>                                                 ^^^^^^^^^^^^^^^^^
> Existing code assumes substream can be NULL.
>
>      78			snd_rawmidi_transmit_ack(substream, port->consume_bytes);
>      79		else if (!rcode_is_permanent_error(rcode))
>      80			/* To start next transaction immediately for recovery. */
>      81			port->next_ktime = ktime_set(0, 0);
>      82		else
>      83			/* Don't continue processing. */
>      84			port->error = true;
>      85	
>      86		port->idling = true;
>      87	
>      88		if (!snd_rawmidi_transmit_empty(substream))
>                                                  ^^^^^^^^^
> Patch adds an unchecked dereference (inside the function call).
>
>      89			schedule_work(&port->work);
>      90	}
>
> regards,
> dan carpenter

Indeed. I'll fix this bug in this weekend.


Thanks

Takashi Sakamoto

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-15  8:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-15  7:04 ALSA: firewire-lib: schedule work again when MIDI substream has rest of MIDI messages Dan Carpenter
2015-10-15  8:18 ` Takashi Sakamoto

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.