From patchwork Fri Jul 8 07:25:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 150 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Fri, 08 Jul 2011 09:44:43 -0300 Received: from mchehab by infradead.org with local (Exim 4.72) (envelope-from ) id 1QfAQE-00036h-Qt for mchehab@infradead.org; Fri, 08 Jul 2011 09:44:43 -0300 Received: from casper.infradead.org [85.118.1.10] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Fri, 08 Jul 2011 09:44:42 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qf5So-0002rX-JJ; Fri, 08 Jul 2011 07:27:02 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751517Ab1GHH07 (ORCPT + 1 other); Fri, 8 Jul 2011 03:26:59 -0400 Received: from mail-pw0-f46.google.com ([209.85.160.46]:38110 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750985Ab1GHH06 (ORCPT ); Fri, 8 Jul 2011 03:26:58 -0400 Received: by pwj7 with SMTP id 7so965020pwj.19 for ; Fri, 08 Jul 2011 00:26:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=el6ZEWl6t3WyL0CRVwal58jQBoruSvOIjqMFSseaTMY=; b=Vo0qpamkhZY/HlhLVofmpQXG/ITi737BYj39ROxXTEsdOgiDJWcYEDKE/cEQX8rQUW 4zt7LuqGcpasxlANx1DGXzDv8s1JZCIpjKF2Ah+6rW0bwRbJsAv8H0yz6Myo6gPgWGtv XTD76O0Upmv/syI/dn/dTgr6YFOIq2ssIdNSM= Received: by 10.142.238.7 with SMTP id l7mr147959wfh.49.1310110017880; Fri, 08 Jul 2011 00:26:57 -0700 (PDT) Received: from shale.localdomain ([41.139.221.94]) by mx.google.com with ESMTPS id l10sm6596641wfk.21.2011.07.08.00.26.51 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Jul 2011 00:26:57 -0700 (PDT) Date: Fri, 8 Jul 2011 10:25:40 +0300 From: Dan Carpenter To: Greg Kroah-Hartman Cc: Mauro Carvalho Chehab , Stefan Ringel , "Beholder Intl. Ltd. Dmitry Belimov" , Hans Verkuil , "open list:STAGING - TRIDENT..." , "open list:STAGING SUBSYSTEM" , kernel-janitors@vger.kernel.org Subject: [patch] Staging: tm6000: remove unneeded check in get_next_buf() Message-ID: <20110708072540.GV18655@shale.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: We dereference "buf" on the line before so if it were NULL here we would have OOPsed earlier. Also list_entry() never returns NULL. And finally, we handled the situation where the list is empty earlier in the function. So this test isn't needed and I've removed it. 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/staging/tm6000/tm6000-video.c b/drivers/staging/tm6000/tm6000-video.c index 3fe6038..8d8b939 100644 --- a/drivers/staging/tm6000/tm6000-video.c +++ b/drivers/staging/tm6000/tm6000-video.c @@ -179,9 +179,6 @@ static inline void get_next_buf(struct tm6000_dmaqueue *dma_q, *buf = list_entry(dma_q->active.next, struct tm6000_buffer, vb.queue); - if (!buf) - return; - /* Cleans up buffer - Useful for testing for frame/URB loss */ outp = videobuf_to_vmalloc(&(*buf)->vb);