Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752758Ab1CMF35 (ORCPT ); Sun, 13 Mar 2011 00:29:57 -0500 Received: from mail-qy0-f181.google.com ([209.85.216.181]:60998 "EHLO mail-qy0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751399Ab1CMF3d (ORCPT ); Sun, 13 Mar 2011 00:29:33 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=YNemYIcI3zwje3JUXcVzVAROP/lnfhrgdCT7pnBYsUHUxoaD5LRxHMhox9uX+AL+7S +qTxK0QbCw78OYRPuRIZrryXhZpzN2XqamgPcUK939tMQ9pJYVFYF6l84wt+CfN0y2GM rtuHvl2xWfPE3uuJQkkrnyb0ZGaHPy1F83ksQ= From: Ilia Mirkin To: Greg Kroah-Hartman Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/24] staging: cx25821: Remove NULL check before kfree Date: Sun, 13 Mar 2011 00:28:58 -0500 Message-Id: <1299994157-11191-6-git-send-email-imirkin@alum.mit.edu> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1299994157-11191-5-git-send-email-imirkin@alum.mit.edu> References: <20110222145452.GD1331@suse.de> <1299994157-11191-1-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-2-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-3-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-4-git-send-email-imirkin@alum.mit.edu> <1299994157-11191-5-git-send-email-imirkin@alum.mit.edu> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3007 Lines: 90 This patch was generated by the following semantic patch: // @@ expression E; @@ - if (E != NULL) { kfree(E); } + kfree(E); @@ expression E; @@ - if (E != NULL) { kfree(E); E = NULL; } + kfree(E); + E = NULL; // Signed-off-by: Ilia Mirkin --- drivers/staging/cx25821/cx25821-audio-upstream.c | 9 +++------ .../staging/cx25821/cx25821-video-upstream-ch2.c | 9 +++------ 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 7992a3b..0f9ca77 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 e2efacd..655357d 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 31b4e3c..eb0172b 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); -- 1.7.3.4 -- 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/