lkml.org 
[lkml]   [2005]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[DVB patch 41/48] vfree() checking cleanups
vfree() checking cleanups.

Signed-off by: James Lamanna <jlamanna@gmail.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Johannes Stezenbach <js@linuxtv.org>

dvb-core/dmxdev.c | 16 +++++-----------
dvb-core/dvb_ca_en50221.c | 3 +--
ttpci/budget-core.c | 3 +--
3 files changed, 7 insertions(+), 15 deletions(-)

Index: linux-2.6.12-rc1-mm1/drivers/media/dvb/dvb-core/dmxdev.c
===================================================================
--- linux-2.6.12-rc1-mm1.orig/drivers/media/dvb/dvb-core/dmxdev.c 2005-03-21 23:27:56.000000000 +0100
+++ linux-2.6.12-rc1-mm1/drivers/media/dvb/dvb-core/dmxdev.c 2005-03-22 00:28:04.000000000 +0100
@@ -304,8 +304,7 @@ static int dvb_dmxdev_set_buffer_size(st
buf->size=size;
buf->pwrite=buf->pread=0;
spin_unlock_irq(&dmxdevfilter->dev->lock);
- if (mem)
- vfree(mem);
+ vfree(mem);

if (buf->size) {
mem=vmalloc(dmxdevfilter->buffer.size);
@@ -1129,15 +1128,10 @@ dvb_dmxdev_release(struct dmxdev *dmxdev
dvb_unregister_device(dmxdev->dvbdev);
dvb_unregister_device(dmxdev->dvr_dvbdev);

- if (dmxdev->filter) {
- vfree(dmxdev->filter);
- dmxdev->filter=NULL;
- }
-
- if (dmxdev->dvr) {
- vfree(dmxdev->dvr);
- dmxdev->dvr=NULL;
- }
+ vfree(dmxdev->filter);
+ dmxdev->filter=NULL;
+ vfree(dmxdev->dvr);
+ dmxdev->dvr=NULL;
dmxdev->demux->close(dmxdev->demux);
}
EXPORT_SYMBOL(dvb_dmxdev_release);
Index: linux-2.6.12-rc1-mm1/drivers/media/dvb/ttpci/budget-core.c
===================================================================
--- linux-2.6.12-rc1-mm1.orig/drivers/media/dvb/ttpci/budget-core.c 2005-03-21 23:27:56.000000000 +0100
+++ linux-2.6.12-rc1-mm1/drivers/media/dvb/ttpci/budget-core.c 2005-03-22 00:28:04.000000000 +0100
@@ -415,8 +415,7 @@ int ttpci_budget_init(struct budget *bud
err:
i2c_del_adapter(&budget->i2c_adap);

- if (budget->grabbing)
- vfree(budget->grabbing);
+ vfree(budget->grabbing);

dvb_unregister_adapter(budget->dvb_adapter);

Index: linux-2.6.12-rc1-mm1/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
===================================================================
--- linux-2.6.12-rc1-mm1.orig/drivers/media/dvb/dvb-core/dvb_ca_en50221.c 2005-03-22 00:27:13.000000000 +0100
+++ linux-2.6.12-rc1-mm1/drivers/media/dvb/dvb-core/dvb_ca_en50221.c 2005-03-22 00:28:04.000000000 +0100
@@ -804,8 +804,7 @@ static int dvb_ca_en50221_slot_shutdown(
down_write(&ca->slot_info[slot].sem);
ca->pub->slot_shutdown(ca->pub, slot);
ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE;
- if (ca->slot_info[slot].rx_buffer.data)
- vfree(ca->slot_info[slot].rx_buffer.data);
+ vfree(ca->slot_info[slot].rx_buffer.data);
ca->slot_info[slot].rx_buffer.data = NULL;
up_write(&ca->slot_info[slot].sem);

--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:11    [W:0.233 / U:3.752 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site