Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1580179iog; Tue, 14 Jun 2022 08:48:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/TnrIaf2/YmqQaw9c8zCa658E0lWnilqV7D3mjTmClR/oyBgOFogULne8Jp+sXpEhkK/W X-Received: by 2002:a63:fd0f:0:b0:3fa:5e0b:a434 with SMTP id d15-20020a63fd0f000000b003fa5e0ba434mr5078745pgh.493.1655221684952; Tue, 14 Jun 2022 08:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655221684; cv=none; d=google.com; s=arc-20160816; b=N4/keCN64p7hLZz53/HdvOBonpY9fAsvg8tltPCGcwpQ3JM/RrmLK4Gj2CExp9CMVC sxxvnWSzJCvNFLrI4QqJBJbia1rnPlPinLF47b3/K5WP9xd/5xCe7zN6+tMA9xE9ghd1 DiG86+/EEPt8Uc8sPhSBb1P87AOl2G0Fnnmji6c0RzEYuuqfFIqKaI3+0BFSS39wwEgg SmhZLDa8lqJ/l7iNWhZVgAUdOAqRjmJpuJTrDQzKklNqYnFpnzdPqchrReynLvWPFeQ+ Kalvx323gdWQWiIEhmiOX320WYUw4XB2xtRbmnbosuOGNwe1FaYxU7z3yaJeR3ZJwDix z37A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7z4vXYvVUCA3uu83cZBXL9cYFVEEnptqo5RviKf/2TQ=; b=loCdAtbm4oQDXhJ/lssBWq6yqQCx3OubWhLLCXfR/qGq/MbdtzP7+Jv5SZ4961xAZw Ktb4oWmVsQ4TySAPI5ZvhreqQYuHIKwqlO/9GRqm6HJdXhiGXPnmQvfQIPpsfP+2yrn3 8Wlpsgb3+N7nKZM7stPJdt5CEPi9ezrtSUktbJGpKu5RI//IcNYLSX5GWnafL3HXWGPk aP44z8/lkyoXRBGQCR2nKzQtcAK8vD8Aml58F3ZITaypxxIYgetAtVIUWVQeD7P2z6eH KuSwFnuo6S5y/3lBq5YL9lM2uxMw4zCWbeKbI7yG2RPjlAO/zQlFxyZk6Pdt0rXsNBPo giGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vo6xERnY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y3-20020a655a03000000b003f9f28dd8e9si14839610pgs.794.2022.06.14.08.47.52; Tue, 14 Jun 2022 08:48:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vo6xERnY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241888AbiFNPNw (ORCPT + 99 others); Tue, 14 Jun 2022 11:13:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237072AbiFNPNv (ORCPT ); Tue, 14 Jun 2022 11:13:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC8CC377FC for ; Tue, 14 Jun 2022 08:13:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 78A6460C87 for ; Tue, 14 Jun 2022 15:13:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DB42C3411B; Tue, 14 Jun 2022 15:13:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655219628; bh=aAruh180MgBrPRKPWzJtrQlciVl99j09DArcIaC5JuA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vo6xERnY0mIFVPT72fgBS0EyPCI49PtIoEaRADdJsq4OgOQVuN8dThhg3ROsgxVFb XZtjzBg0PVRrLN1iupv1tt6q7viTbXvOrEI2rFHkHRHM5+rF0wgjwxXzoCTO8OflXw n/JtVyF1WC59q3k76iQuuq1SjHtI+zagNFCTJMjw= Date: Tue, 14 Jun 2022 17:13:45 +0200 From: Greg KH To: Zhi Song Cc: vilhelm.gray@gmail.com, rafael@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] isa: put_device after failing to device_register Message-ID: References: <20220614145757.1734996-1-zhi.song@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220614145757.1734996-1-zhi.song@bytedance.com> X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 14, 2022 at 10:57:57PM +0800, Zhi Song wrote: > device_register() is used to register a device with the system. > > We cannot directly free dev after calling this function, > even if it returns an error. > > We should use put_device() to give up the reference > initialized in this function instead. Same comments on this one as my last review. greg k-h