From patchwork Wed May 5 05:59:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 3303 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Wed, 05 May 2010 06:00:08 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.6) for (single-drop); Wed, 05 May 2010 03:04:27 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1O9XeS-0008L2-Jy; Wed, 05 May 2010 06:00:08 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754657Ab0EEGAG (ORCPT + 1 other); Wed, 5 May 2010 02:00:06 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:64880 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752789Ab0EEGAE (ORCPT ); Wed, 5 May 2010 02:00:04 -0400 Received: by fxm10 with SMTP id 10so3900400fxm.19 for ; Tue, 04 May 2010 23:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=8hYBY8d39aF6htSAhg9/0xCHSTs48yQSOp1kU6N3mLM=; b=rZ8VD9vGwbjE7jEGDWPxTLz/42DFsjFblVAwxzzMuNyYNLPi9/ItcAaYy/mf07+FlO FQp9NmeF4TfNLAfQy5+QeS12sqUEJqaKIZhTpZpobzuWMo4Lf22h19iuEJhxPRaA6tk7 I7gXAORr1vvZnGVYpbeOFR3DZoU/uTeppIEA0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=ak/63rNRx8MRgfNADNI3jz6o1/SE5aqfWsjZ+BjR6hBT69f444Si2oeoxiYJRNpq4o oQ0DAq6yoZS3/EZwN8oeofbW6GCDMaKaGGIDsLv2Xf6zA/tsQUDQFCi+ZyWca+E5PHln S0tdzsGimMNKMZVE3xQxNA5/8RNpJYsinudVA= Received: by 10.223.21.23 with SMTP id h23mr4988949fab.21.1273039202697; Tue, 04 May 2010 23:00:02 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id 21sm12838990fkx.10.2010.05.04.23.00.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 04 May 2010 23:00:02 -0700 (PDT) Date: Wed, 5 May 2010 07:59:48 +0200 From: Dan Carpenter To: linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab Subject: [patch] media/ov511: cleanup: remove unneeded null check Message-ID: <20100505055948.GE27064@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org We dereference "ov" unconditionally throughout the function so there is no way it can be NULL here. This code has been around for ages so if it were possible for "ov" to be NULL someone would have complained. Signed-off-by: Dan Carpenter --- 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/ov511.c b/drivers/media/video/ov511.c index 6085d55..a109120 100644 --- a/drivers/media/video/ov511.c +++ b/drivers/media/video/ov511.c @@ -5940,7 +5940,7 @@ ov51x_disconnect(struct usb_interface *intf) ov->dev = NULL; /* Free the memory */ - if (ov && !ov->user) { + if (!ov->user) { mutex_lock(&ov->cbuf_lock); kfree(ov->cbuf); ov->cbuf = NULL;