From c47b4ac059887d222399286eb2e4dea319726adb Mon Sep 17 00:00:00 2001 From: Kenneth Aafloy Date: Wed, 9 Mar 2005 15:52:00 +0000 Subject: - kfree(NULL) is safe --- linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c | 3 +-- linux/drivers/media/dvb/dvb-core/dvb_frontend.c | 3 +-- linux/drivers/media/dvb/dvb-core/dvbdev.c | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) (limited to 'linux/drivers/media/dvb/dvb-core') diff --git a/linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c index fdc949ff1..8af9f3050 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c @@ -1733,8 +1733,7 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter, if (ca != NULL) { if (ca->dvbdev != NULL) dvb_unregister_device(ca->dvbdev); - if (ca->slot_info != NULL) - kfree(ca->slot_info); + kfree(ca->slot_info); kfree(ca); } pubca->private = NULL; diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c index 60c888eb2..59a9adfae 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -908,8 +908,7 @@ int dvb_unregister_frontend(struct dvb_frontend* fe) else printk("dvb_frontend: Demodulator (%s) does not have a release callback!\n", fe->ops->info.name); /* fe is invalid now */ - if (fepriv) - kfree(fepriv); + kfree(fepriv); up (&frontend_mutex); return 0; } diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c index fa857dd48..73fd74fcf 100644 --- a/linux/drivers/media/dvb/dvb-core/dvbdev.c +++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c @@ -395,9 +395,7 @@ int dvb_usercopy(struct inode *inode, struct file *file, } out: - if (mbuf) - kfree(mbuf); - + kfree(mbuf); return err; } -- cgit v1.2.3