Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp51273yba; Fri, 3 May 2019 20:25:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqzoNN8idUtZbIOdkRZZQzDxJ3F1Bx0cn10O1uGcJFxmXUom8KAxbP5op1TSoY8oSdM/QQN+ X-Received: by 2002:a63:f64f:: with SMTP id u15mr15322057pgj.192.1556940302161; Fri, 03 May 2019 20:25:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556940302; cv=none; d=google.com; s=arc-20160816; b=jFESTmrZ2pRUAViRfb2XcDxUozuneEVctyvPfLHTmGteTiqIhV9a06Snd9emRsry+9 Tzioat7ROuUYLA0HaZdMTxggplAK4BB30Si7G7Le1185jLSmxkHVsWsoVitPBzATzJFg zqRVNonAL2LDmzYoqCGJ550MFgszxd8T4ll/xkeU7tY3K5peMjuxYPOi5+PUfw2kniGQ to+yoHiTnzuSCCiZbGhV1ajLMwJHoLbmDAWQibTQ0aIflRwcFJg+5bCJ2/Fgb1GXKgk3 eF3SBJw+llQUgLV97pYdR7THe3XCKpwBwCTGSamZf2dFlCNQ4MGxHf5Y84R2qcW0CQ4n +4ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=MmgB6D6cD2ujF5V6JurPgRGBiffVIIZgfuced8CLnIA=; b=sL4Zt76kBI2JJpkB/b1tIp9GoV35IPp7K5/Jv+kdKCRbeHaDK3hUJ87dyfuqAhwtpz 57VjK/3l9w4kPE9/xCt5Mcbwbt4+ELYhE/do6ZMos8AftyjyWm+GY8pC8eOJlMdw/pxB 9YvmfZk5pAgcELOmQ3LRC7RfdyHf9Qo0vdJfgoI68R/U8GEHnkdbRKQDXYjBuAuNmwvy RTED9qjoXWb+O42u7vuUYNUzgu/g3TMNiIfWurMi7kU0g7yLnf3n8Vd8mnd8hAH2DUQf tIjUAy3YTHczSWFlUX85hYWy4TydGlyx9ktdn1FTtNkgTHuW66tGxfqnvQyARb8TsH0Q 4pKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10si4952917pll.40.2019.05.03.20.24.43; Fri, 03 May 2019 20:25:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726943AbfEDDPF (ORCPT + 99 others); Fri, 3 May 2019 23:15:05 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:55096 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726579AbfEDDPF (ORCPT ); Fri, 3 May 2019 23:15:05 -0400 Received: from localhost (unknown [75.104.87.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 8DDE714D44B36; Fri, 3 May 2019 20:15:00 -0700 (PDT) Date: Fri, 03 May 2019 23:13:08 -0400 (EDT) Message-Id: <20190503.231308.1440125282445011089.davem@davemloft.net> To: baijiaju1990@gmail.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: via-rhine: net: Fix a resource leak in rhine_init() From: David Miller In-Reply-To: <20190504030813.17684-1-baijiaju1990@gmail.com> References: <20190504030813.17684-1-baijiaju1990@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 03 May 2019 20:15:04 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jia-Ju Bai Date: Sat, 4 May 2019 11:08:13 +0800 > When platform_driver_register() fails, pci_unregister_driver() is not > called to release the resource allocated by pci_register_driver(). > > To fix this bug, error handling code for platform_driver_register() and > pci_register_driver() is separately implemented. > > This bug is found by a runtime fuzzing tool named FIZZER written by us. > > Signed-off-by: Jia-Ju Bai I think the idea here is that PCI is not enabled in the kernel, it is fine for the pci register to fail and only the platform register to succeed. You are breaking that.