[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <56B9F7F8.1000605@redhat.com>
Date: Tue, 9 Feb 2016 15:30:16 +0100
From: Jerome Marchand <jmarchan@...hat.com>
To: Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>
Cc: alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: Should snd_card_free() check for null pointer?
Hi,
Before commit f24640648186b (ALSA: Use standard device refcount for card
accounting), snd_card_free() would return -EINVAL on a null pointer. Now
it ends up in a null pointer dereference. There is at least one driver
that can call snd_card_free() with null argument: saa7134_alsa. It can
easily be triggered by just inserting and removing the module (no need
to have the hardware).
I don't think that is a rule, but it seems that the standard behavior of
*_free() functions is to check for null pointer. What do you think?
Thanks,
Jerome
Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)
Powered by blists - more mailing lists