Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753076AbbGWKZj (ORCPT ); Thu, 23 Jul 2015 06:25:39 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:48032 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752383AbbGWKZb (ORCPT ); Thu, 23 Jul 2015 06:25:31 -0400 Date: Thu, 23 Jul 2015 13:24:50 +0300 From: Dan Carpenter To: Dexuan Cui Cc: "pebolle@tiscali.nl" , "gregkh@linuxfoundation.org" , "jasowang@redhat.com" , "driverdev-devel@linuxdriverproject.org" , "olaf@aepfle.de" , "linux-kernel@vger.kernel.org" , "stephen@networkplumber.org" , "stefanha@redhat.com" , "netdev@vger.kernel.org" , "apw@canonical.com" , "davem@davemloft.net" Subject: Re: [PATCH V3 3/7] Drivers: hv: vmbus: add APIs to send/recv hvsock packet and get the r/w-ability Message-ID: <20150723102449.GR5371@mwanda> References: <1437476293-6837-1-git-send-email-decui@microsoft.com> <87zj2pk3jf.fsf@vitty.brq.redhat.com> <4538264677374d43961c2d709afb1dd3@SIXPR30MB031.064d.mgd.msft.net> <20150722103546.GO5371@mwanda> <75f1792c788e418eaddc0d6b7e3381de@SIXPR30MB031.064d.mgd.msft.net> <20150723101057.GQ5371@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150723101057.GQ5371@mwanda> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1551 Lines: 30 On Thu, Jul 23, 2015 at 01:10:57PM +0300, Dan Carpenter wrote: > In this specific case, writing it as "if (ret != 0)" caused the bug. If > we had written it as "if (ret) return ret;" then there are no zeroes so > wouldn't have been any temptation to return the zero instead of the ret. I did a search to see if returning the zero instead of the ret was a common mistake and it seems like it might be. I did: grep 'if (ret != 0)' drivers/ -r -A1 -n | grep "return 0;" | perl -ne 's/.c-(\d+)-/.c:$1/; print' drivers/gpu/drm/nouveau/nouveau_display.c:111 return 0; drivers/regulator/wm8400-regulator.c:47 return 0; drivers/platform/x86/dell-laptop.c:859 return 0; drivers/media/dvb-frontends/dibx000_common.c:213 return 0; drivers/media/dvb-frontends/dibx000_common.c:217 return 0; drivers/media/dvb-frontends/dibx000_common.c:235 return 0; drivers/media/dvb-frontends/dibx000_common.c:239 return 0; drivers/hv/channel.c:898 return 0; drivers/hv/channel.c:944 return 0; A bunch of those look suspicious but I don't know the subsystems well enough to be sure. Can you check the last two? 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/