From 09417379be9b126e10ae7dcd7afc20b666146266 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Sat, 25 Jun 2005 14:58:49 -0700 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- sound/oss/ad1848.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sound/oss/ad1848.c') diff --git a/sound/oss/ad1848.c b/sound/oss/ad1848.c index 4384dac3f79..7c835abd99b 100644 --- a/sound/oss/ad1848.c +++ b/sound/oss/ad1848.c @@ -2178,8 +2178,7 @@ void ad1848_unload(int io_base, int irq, int dma_playback, int dma_capture, int if (devc != NULL) { - if(audio_devs[dev]->portc!=NULL) - kfree(audio_devs[dev]->portc); + kfree(audio_devs[dev]->portc); release_region(devc->base, 4); if (!share_dma) -- cgit v1.2.3