Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753382AbbGPHzT (ORCPT ); Thu, 16 Jul 2015 03:55:19 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:21369 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751476AbbGPHzR (ORCPT ); Thu, 16 Jul 2015 03:55:17 -0400 Date: Thu, 16 Jul 2015 10:54:42 +0300 From: Dan Carpenter To: Maninder Singh Cc: forest@alittletooquiet.net, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, gclement@baobob.org, tvboxspy@gmail.com, linux-kernel@vger.kernel.org, joe@perches.com, pankaj.m@samsung.com Subject: Re: [RESEND PATCH 1/1] staging:vt6655: remove checks around dev_kfree_skb Message-ID: <20150716075441.GG5835@mwanda> References: <1436930571-17832-1-git-send-email-maninder1.s@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1436930571-17832-1-git-send-email-maninder1.s@samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1233 Lines: 29 On Wed, Jul 15, 2015 at 08:52:51AM +0530, Maninder Singh wrote: > dev_kfree_skb checks for NULL pointer itself, > Thus no need of explicit NULL check. > I hate these patches. I have told Markus to stop sending them but he has issues so now I only complain when they introduce a bug. There was one bug I have missed because it was a benchmark regression and I knew it was theoretically possible but I didn't know the code well enough to say which were fast paths... My main objection is that relying on the sanity check inside the function call makes the code more subtle to understand. We know we need a NULL check but it is hidden away in another file. The motivation for this patch you are sending is "There is a sanity check in dev_kfree_skb() so let's do an insane thing and save some lines of code." For this particular patch we assume throughout the whole driver that "pTDInfo->skb" can be NULL so making it inconsistent in this one place is wrong. regards, dan carpenter -- 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/