From patchwork Sat Jun 6 09:16:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Figo.zhang" X-Patchwork-Id: 28426 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 n569H3AQ029649 for ; Sat, 6 Jun 2009 09:17:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751445AbZFFJQz (ORCPT ); Sat, 6 Jun 2009 05:16:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752832AbZFFJQz (ORCPT ); Sat, 6 Jun 2009 05:16:55 -0400 Received: from rv-out-0506.google.com ([209.85.198.231]:49036 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751445AbZFFJQy (ORCPT ); Sat, 6 Jun 2009 05:16:54 -0400 Received: by rv-out-0506.google.com with SMTP id f9so826360rvb.1 for ; Sat, 06 Jun 2009 02:16:56 -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=xWL4XnXEzliD1M98WYphWohbaiZ7LIZ6RC1MbbOKUT8=; b=UKCmuC3IJchiCA3yAJecFR5HiNbAzB3Z6wgZ6GxWYzN0O8/hDUVzesc8I2A4WzhGHq ItMgKhSt4DCMt2XcNuHRwMI4GT3f8EpqlPNgA/PnuwwibA+Qf+9yPOTKVe9REKCXyEAt QT2wb+aV7OkwGZOS7TguwkBsZEisTMZLXoPWI= 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=jTs4vNIelHNeoFnAet6xGMf8rY4IWfAJu7icjKI4qlMIgTOJaPVdMndqtq9iR6qgdS IyVfR/qte7vuOY9V8LpVJ5pPHuDXQFQddC5Pjnz1XtJqKXLw802llPalF53QrN/XmeKk zFImkR2AdBNHPjI8IaoEvt/HoSQzoKW1/Toho= Received: by 10.140.173.10 with SMTP id v10mr3591053rve.207.1244279816306; Sat, 06 Jun 2009 02:16:56 -0700 (PDT) Received: from ?221.137.240.219? ([221.137.240.219]) by mx.google.com with ESMTPS id g22sm2641470rvb.36.2009.06.06.02.16.54 (version=SSLv3 cipher=RC4-MD5); Sat, 06 Jun 2009 02:16:55 -0700 (PDT) Subject: [PATCH] zr364xx.c: vfree does its own NULL check From: "Figo.zhang" To: Mauro Carvalho Chehab Cc: Linux Media Mailing List Date: Sat, 06 Jun 2009 17:16:21 +0800 Message-Id: <1244279782.3185.9.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, no need for explicit check before calling it. Signed-off-by: Figo.zhang --- drivers/media/video/zr364xx.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 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/zr364xx.c b/drivers/media/video/zr364xx.c index ac169c9..fc976f4 100644 --- a/drivers/media/video/zr364xx.c +++ b/drivers/media/video/zr364xx.c @@ -882,9 +882,11 @@ static void zr364xx_disconnect(struct usb_interface *intf) video_unregister_device(cam->vdev); cam->vdev = NULL; kfree(cam->buffer); - if (cam->framebuf) - vfree(cam->framebuf); + cam->buffer = NULL; + vfree(cam->framebuf); + cam->framebuf = NULL; kfree(cam); + cam = NULL; }