Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp52271yba; Fri, 3 May 2019 20:26:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrnxKVVtV7I2fvbngQmWST0rq01LH4eAfFS4uL0YPGECW8iu+Gpefrt9Dxa3ne0QC8oT9b X-Received: by 2002:aa7:92d5:: with SMTP id k21mr15996675pfa.223.1556940404144; Fri, 03 May 2019 20:26:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556940404; cv=none; d=google.com; s=arc-20160816; b=h7XGn71W8RskBe2hq2Lu0+CCjVI6+tHiaTwa9xDBe6hEZ49FOG0R/eaqeWOvaIOMoV mudc09tX3GcaUvfq+czJgHPoXAeDbsb/31f04cVvljScILmPYwfSyXFM/QINvwrAekfi oG0J/+qioOenMOKa0d2JiB1OqRi08IoAkQLlH/rH81rW/0c3etBviIhU7IMdGBlm/yZV GO7Q9Isnq3cLYnYpHNr0073FZu9NeRdCVWIelThPgzzk0iiWuaVyWifVfjpOxvXDazew H9KCnwMD3zMINF4w43I1U1MCZAwRnAQBo7bYyrwhv9fVMRV9FoNzZsnFniC8fxJBX7o+ dKaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Dnlfvz2feUoXxK2GPjrd8YKdDGUiEgdiAua8sKIN3WU=; b=SOK6R6gEhen57NdNZkJjNPHh44hANJupu08BjmyQSHEsCFMPFKHr5VFzs3VOfnNG8k vxA7Bxw+OdUGUR52RoO7ucTK3b5lVMD7uynYoSktVz5mocdfnFJwcc5Lbe24wJfEJAw2 CrqVDmBXr9CoYP1HnT0w1gMWqvyNMRm2JZIunKZ41fg19kFi74z+NJy6yz3PAuSY1E+n JWi7dwe0DRABKdEn+K+ZQrhyJuJaPf8MnMwPvn56EfVaWqSz/ex+J95peFVaGZYosTNk palHHf4GDzjzzBtl0wgURtSeN1JE4SjpK9NEuUh75nRsqpNE1+408rT2ScYwSXAZnfuO m1xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=h5YzcEz8; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a62si5136560pla.107.2019.05.03.20.26.28; Fri, 03 May 2019 20:26:44 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=h5YzcEz8; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727036AbfEDDXL (ORCPT + 99 others); Fri, 3 May 2019 23:23:11 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:33696 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726149AbfEDDXL (ORCPT ); Fri, 3 May 2019 23:23:11 -0400 Received: by mail-pg1-f196.google.com with SMTP id k19so3656237pgh.0; Fri, 03 May 2019 20:23:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=Dnlfvz2feUoXxK2GPjrd8YKdDGUiEgdiAua8sKIN3WU=; b=h5YzcEz8N6W218osr0BvSftgUFBrSyyJ954qiTwruL33C0QDTo56XFVMgpr1b+BpRL UEf/w6s+7Ne5X88EUGRj5CLuVNnHSpt0H6wOlAGqfRmR+MAopfWLATZaC0M4uhyQnENo 3iEcroslzRqUoq8BpZyqVweX9lGp8/NJqeXQwiDQUtrbY8Z/K6GzYI+7wXRfkCaPkZyC IQPEzrQtMDTpp8V7M7L+Jfi5wL1M/JZXUNxvODlbeusYDI15khyu60H2eA4bgq0eBcEU jYVM0Md6gCklGi2Wt8eY4JeA6WZD8QVggMQ7kFNte1IAjgXkX5BEJCQlCR9CsQu/XMFA aVEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Dnlfvz2feUoXxK2GPjrd8YKdDGUiEgdiAua8sKIN3WU=; b=GAFfuB7Ts01vNFP+mOzq9RMrxPP8wuKpBwDC/1OjuxcIlc4qGzRQ2gGlLH2jAUd7bY r5h+/nCMdU1d25WwFSHe2dcJTwHfvF84gjF308wj9cDBMBgsm1315hIuMhJjE5gEWwcR t4Hh5llS5n224Tzf3241Yhr12SFGVbX1xtGRB3g0YaCUrxVrsYHOinbPFYzHIAZIGntQ yrctPpzj+/Ph9Y6RJueTFhPaO9q4oGPi2tVOC5Lf3WRJmrJwDVc+LHpr3N+pkFb52C2a rSN+LgkvjPP1D2S9RLKXDOjFPDwYPxAX3hONEbfpCpZdok+pvNfK2LrhNpr6DFqNoyGU AcGA== X-Gm-Message-State: APjAAAU5k2PxGRONqSSZTMf2DN7iBND97elDOVX8VaWhK/LddDeEJaEB iY/A8Y7p6S31Hf0GTd9tBgGE84YZ X-Received: by 2002:a63:1a42:: with SMTP id a2mr15032888pgm.358.1556940190465; Fri, 03 May 2019 20:23:10 -0700 (PDT) Received: from ?IPv6:2402:f000:1:1501:200:5efe:166.111.71.43? ([2402:f000:1:1501:200:5efe:a66f:472b]) by smtp.gmail.com with ESMTPSA id k26sm4400902pfi.136.2019.05.03.20.23.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 May 2019 20:23:09 -0700 (PDT) Subject: Re: [PATCH] net: via-rhine: net: Fix a resource leak in rhine_init() To: David Miller Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190504030813.17684-1-baijiaju1990@gmail.com> <20190503.231308.1440125282445011089.davem@davemloft.net> From: Jia-Ju Bai Message-ID: Date: Sat, 4 May 2019 11:23:06 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20190503.231308.1440125282445011089.davem@davemloft.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/5/4 11:13, David Miller wrote: > 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. Okay, I can understand it. If so, I think that platform_driver_register() should be called before pci_register_driver(), and it is still necessary to separately handle their errors. If you agree, I will send a v2 patch. Best wishes, Jia-Ju Bai