From patchwork Sat Jun 6 10:06:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Figo.zhang" X-Patchwork-Id: 28430 X-Patchwork-Delegate: dougsland@redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n56A7U1f032605 for ; Sat, 6 Jun 2009 10:07:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751740AbZFFKH0 (ORCPT ); Sat, 6 Jun 2009 06:07:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752481AbZFFKH0 (ORCPT ); Sat, 6 Jun 2009 06:07:26 -0400 Received: from rv-out-0506.google.com ([209.85.198.233]:59400 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751740AbZFFKHZ (ORCPT ); Sat, 6 Jun 2009 06:07:25 -0400 Received: by rv-out-0506.google.com with SMTP id f9so831855rvb.1 for ; Sat, 06 Jun 2009 03:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=IOAcrmwfqZwIxXFg3cm05DJ6JCIbn/GO4f4kGpZrdQs=; b=PZbM+IA50DkApUqj8kqUBLEYnf47T949ks8b6vXMEYrUhVMRngP94zef+dwepwne8N h/X+K5m+CX6OZ8hAAfM2r9Hz4uDqX7j6dkb3OqJG//NmcM6uAUA983RvkGB10+7Fj5my Abf2RxZz5nyb6OW+rcyam76ByrHMU42+vVwVI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=wSyvMITgBr6gzlL+MxCH19hZC+vGajHxDqMVcPl8DCz2FWkbT/EHBVKL8P61RPeOVc qY3Q0OUh/n9vmzNhzU03dwI5lcvf/01XExJV9anDDz2aKPZB6civS0uhR1CaMCUf093W K1mJWMAWkG6JUUc8OQw3xCzCyOlqtyL6JNrsg= Received: by 10.141.137.8 with SMTP id p8mr3720996rvn.27.1244282847504; Sat, 06 Jun 2009 03:07:27 -0700 (PDT) Received: from ?221.137.240.219? ([221.137.240.219]) by mx.google.com with ESMTPS id b8sm2787205rvf.34.2009.06.06.03.07.24 (version=SSLv3 cipher=RC4-MD5); Sat, 06 Jun 2009 03:07:27 -0700 (PDT) Subject: [PATCH]usbvision-core.c: vfree does its own NULL check From: "Figo.zhang" To: Mauro Carvalho Chehab Cc: Linux Media Mailing List Date: Sat, 06 Jun 2009 18:06:49 +0800 Message-Id: <1244282809.3185.14.camel@myhost> Mime-Version: 1.0 X-Mailer: Evolution 2.26.2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org vfree() does it's own NULL checking,so no need for check before calling it. Signed-off-by: Figo.zhang --- drivers/media/video/usbvision/usbvision-core.c | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-) --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c index 8bc03b9..1603b2b 100644 --- a/drivers/media/video/usbvision/usbvision-core.c +++ b/drivers/media/video/usbvision/usbvision-core.c @@ -390,10 +390,9 @@ int usbvision_scratch_alloc(struct usb_usbvision *usbvision) void usbvision_scratch_free(struct usb_usbvision *usbvision) { - if (usbvision->scratch != NULL) { - vfree(usbvision->scratch); - usbvision->scratch = NULL; - } + vfree(usbvision->scratch); + usbvision->scratch = NULL; + } /* @@ -506,10 +505,9 @@ int usbvision_decompress_alloc(struct usb_usbvision *usbvision) */ void usbvision_decompress_free(struct usb_usbvision *usbvision) { - if (usbvision->IntraFrameBuffer != NULL) { - vfree(usbvision->IntraFrameBuffer); - usbvision->IntraFrameBuffer = NULL; - } + vfree(usbvision->IntraFrameBuffer); + usbvision->IntraFrameBuffer = NULL; + } /************************************************************