diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2011-03-13 00:28:58 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-03-14 11:57:31 -0700 |
commit | b00917802bda6eba09125e8b4d273339188f9bad (patch) | |
tree | 2f98d5ea5eb9b51f229a6e895e42f2fc23e0bb53 | |
parent | e4e1f289be88a75dc8b63d50ade1f9a2e6168021 (diff) |
staging: cx25821: Remove NULL check before kfree
This patch was generated by the following semantic patch:
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);
@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/cx25821/cx25821-audio-upstream.c | 9 | ||||
-rw-r--r-- | drivers/staging/cx25821/cx25821-video-upstream-ch2.c | 9 | ||||
-rw-r--r-- | drivers/staging/cx25821/cx25821-video-upstream.c | 9 |
3 files changed, 9 insertions, 18 deletions
diff --git a/drivers/staging/cx25821/cx25821-audio-upstream.c b/drivers/staging/cx25821/cx25821-audio-upstream.c index 7992a3ba526f..0f9ca777bd4d 100644 --- a/drivers/staging/cx25821/cx25821-audio-upstream.c +++ b/drivers/staging/cx25821/cx25821-audio-upstream.c @@ -244,13 +244,10 @@ void cx25821_stop_upstream_audio(struct cx25821_dev *dev) dev->_audioframe_count = 0; dev->_audiofile_status = END_OF_FILE; - if (dev->_irq_audio_queues) { - kfree(dev->_irq_audio_queues); - dev->_irq_audio_queues = NULL; - } + kfree(dev->_irq_audio_queues); + dev->_irq_audio_queues = NULL; - if (dev->_audiofilename != NULL) - kfree(dev->_audiofilename); + kfree(dev->_audiofilename); } void cx25821_free_mem_upstream_audio(struct cx25821_dev *dev) diff --git a/drivers/staging/cx25821/cx25821-video-upstream-ch2.c b/drivers/staging/cx25821/cx25821-video-upstream-ch2.c index e2efacdfb874..655357da3d6a 100644 --- a/drivers/staging/cx25821/cx25821-video-upstream-ch2.c +++ b/drivers/staging/cx25821/cx25821-video-upstream-ch2.c @@ -234,13 +234,10 @@ void cx25821_stop_upstream_video_ch2(struct cx25821_dev *dev) dev->_frame_count_ch2 = 0; dev->_file_status_ch2 = END_OF_FILE; - if (dev->_irq_queues_ch2) { - kfree(dev->_irq_queues_ch2); - dev->_irq_queues_ch2 = NULL; - } + kfree(dev->_irq_queues_ch2); + dev->_irq_queues_ch2 = NULL; - if (dev->_filename_ch2 != NULL) - kfree(dev->_filename_ch2); + kfree(dev->_filename_ch2); tmp = cx_read(VID_CH_MODE_SEL); cx_write(VID_CH_MODE_SEL, tmp & 0xFFFFFE00); diff --git a/drivers/staging/cx25821/cx25821-video-upstream.c b/drivers/staging/cx25821/cx25821-video-upstream.c index 31b4e3c74c8d..eb0172bf39d1 100644 --- a/drivers/staging/cx25821/cx25821-video-upstream.c +++ b/drivers/staging/cx25821/cx25821-video-upstream.c @@ -279,13 +279,10 @@ void cx25821_stop_upstream_video_ch1(struct cx25821_dev *dev) dev->_frame_count = 0; dev->_file_status = END_OF_FILE; - if (dev->_irq_queues) { - kfree(dev->_irq_queues); - dev->_irq_queues = NULL; - } + kfree(dev->_irq_queues); + dev->_irq_queues = NULL; - if (dev->_filename != NULL) - kfree(dev->_filename); + kfree(dev->_filename); tmp = cx_read(VID_CH_MODE_SEL); cx_write(VID_CH_MODE_SEL, tmp & 0xFFFFFE00); |