summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xalsa.c20
-rw-r--r--core.c5
2 files changed, 12 insertions, 13 deletions
diff --git a/alsa.c b/alsa.c
index 44e0b15..738048f 100755
--- a/alsa.c
+++ b/alsa.c
@@ -203,17 +203,17 @@ int avirt_alsa_register(struct platform_device *devptr)
*/
int avirt_alsa_deregister(void)
{
+ CHK_NULL(_driver->card);
snd_card_free(_driver->card);
-
- if (_driver->playback.config)
- kfree(_driver->playback.config);
- if (_driver->playback.streams)
- kfree(_driver->playback.streams);
- if (_driver->capture.config)
- kfree(_driver->capture.config);
- if (_driver->capture.streams)
- kfree(_driver->capture.streams);
-
+ CHK_NULL(_driver->playback.config);
+ kfree(_driver->playback.config);
+ CHK_NULL(_driver->playback.streams);
+ kfree(_driver->playback.streams);
+ CHK_NULL(_driver->capture.config);
+ kfree(_driver->capture.config);
+ CHK_NULL(_driver->capture.streams);
+ kfree(_driver->capture.streams);
+ CHK_NULL(_driver);
kfree(_driver);
return 0;
diff --git a/core.c b/core.c
index bf31f0b..996a452 100644
--- a/core.c
+++ b/core.c
@@ -151,9 +151,8 @@ static int avirt_probe(struct platform_device *devptr)
*/
static int avirt_remove(struct platform_device *devptr)
{
- avirt_alsa_deregister();
-
- return 0;
+ DPRINTK();
+ return avirt_alsa_deregister();
}
static struct platform_driver avirt_driver = {