From: Julia Lawall Date: Sat, 17 Oct 2009 06:33:22 +0000 (+0200) Subject: ALSA: sound: Move dereference after NULL test and drop unnecessary NULL tests X-Git-Tag: v2.6.32-rc6~14^2~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b3be6afa4ab8b3fdce39df68bad71f8b85164de;p=pandora-kernel.git ALSA: sound: Move dereference after NULL test and drop unnecessary NULL tests In pcm.c, if the NULL test on pcm is needed, then the dereference should be after the NULL test. In dummy.c and ali5451.c, the context of the calls to snd_card_dummy_new_mixer and snd_ali_free_voice show that dummy and pvoice, respectively cannot be NULL. A simplified version of the semantic match that detects this problem is as follows (http://coccinelle.lip6.fr/): // @match exists@ expression x, E; identifier fld; @@ * x->fld ... when != \(x = E\|&x\) * x == NULL // Signed-off-by: Julia Lawall Signed-off-by: Takashi Iwai --- Reading git-diff-tree failed