[alsa-devel] Make snd_card_free() a no-op again for NULL ptr argument

Delio Brignoli dbrignoli at audioscience.com
Thu Jun 29 12:46:33 CEST 2017


Hello Takashi,

Commit “ALSA: Use standard device refcount for card accounting” <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/sound/core/init.c?h=v4.12-rc6&id=f24640648186b59bd39f8cd640d631bdb61a3197> changed the behaviour of snd_card_free() in case of a NULL ptr argument. Before f24640648186b59bd39f8cd640d631bdb61a3197 snd_card_free() was a no-op in case of a NULL ptr argument as I would expect for a *_free() function. Currently passing a NULL ptr results in a NULL ptr dereference.

I believe the previous behaviour is worth restoring. If you agree I’ll follow up with a patch.

Thank you.
—
Delio





More information about the Alsa-devel mailing list