[PATCH] remove redundant NULL checks before kfree() in sound/ and avoid casting pointers about to be kfree()'ed
Checking a pointer for NULL before calling kfree() on it is redundant, kfree() deals with NULL pointers just fine. This patch removes such checks from sound/ This patch also makes another, but closely related, change. It avoids casting pointers about to be kfree()'ed. Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
4ae6673e02
commit
09417379be
@@ -1240,8 +1240,7 @@ void unload_mpu401(struct address_info *hw_config)
|
||||
p=mpu401_synth_operations[n];
|
||||
sound_unload_mididev(n);
|
||||
sound_unload_timerdev(hw_config->slots[2]);
|
||||
if(p)
|
||||
kfree(p);
|
||||
kfree(p);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user