Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1519755iog; Tue, 14 Jun 2022 07:40:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vaUhZumzthVGFb9Fj5DFcelwJ/HBUwU7Y1zCBCmzkOvZfLdEacoM5/FIXr5q4mkHS5SRGX X-Received: by 2002:aa7:83d4:0:b0:51c:3949:9c93 with SMTP id j20-20020aa783d4000000b0051c39499c93mr4739662pfn.10.1655217615878; Tue, 14 Jun 2022 07:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655217615; cv=none; d=google.com; s=arc-20160816; b=ZpO+hbw1Nhh/0Q9gtd/GwlIqHfhYlal4JgHAEyWvqE40uNFYWEPwe3tAWVJ71Y2BXA OTUBW0Wuvy7QyrGzW9SxS+E3AxVztVtrD09o2wjgiw47U71zT4mMUY+1dg/zXo2r8Qy/ kkmQfn5wfa2RZDMsvBWnDx743MR9RM+XgrkjWqSYeZ7gi3rL+zA9gDWzyd+j4MQ2pEKt 6GHhxEg+98vrjOeOaLx4CJVjlLfeop7ir+semZglYbMyIzRGGVcEBCdDcI6u3FSc9HGL SK6/HZ2ZQDngKU4ieJVY7GMPDkh380BeR2GYLZfyEWp3ZQ7CBfj0y0l3MXWEcMvxWYJS OiLg== 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=a0DtV6Bqw49YXCp2v98POscrZabCUPGuMpppXfQ2SfA=; b=Q/wqqSFh/dEZmbhWi9c3uH4gotUq2NCKHBNqOnzVr5uyNb0t0+ojeyhzGbfmktRZLV VCtMAwEwGMMVpGgeUSuNBCsDyjHjvq2AqlJjzMedw2O1CfJ9qWY85IMqXUFwez/BiGVd t/JEvDTeju20RkMDMk0BHW9gbLQHmOKoNnAMNZr64oc8rI9//IHVIUvDY65fh68FgfuF hKRIi6N/Nt2kb1cKf4AGJpbees15u0bcguGVIc8AnW2Ion7CwABelCx+30ro/+YfDdGN j5h2ywusWHnJ9ruKCsIWhFe9tHksyWkTs39SNoXCg2a10rwWJ6QPSmItbWpGoJlZDy5D ezSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fFnZLvAl; 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 k19-20020a634b53000000b003fc886ae312si14176128pgl.42.2022.06.14.07.40.03; Tue, 14 Jun 2022 07:40:15 -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=fFnZLvAl; 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 S242479AbiFNOiH (ORCPT + 99 others); Tue, 14 Jun 2022 10:38:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240402AbiFNOiC (ORCPT ); Tue, 14 Jun 2022 10:38:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B2F2219C for ; Tue, 14 Jun 2022 07:38:00 -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 0925A617B4 for ; Tue, 14 Jun 2022 14:38:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15F83C341C5; Tue, 14 Jun 2022 14:37:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655217479; bh=O2hbvfNL0U6Gmj0eop3EmGulD+25t5gAdtIX+9CBfQQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fFnZLvAlOH/yTshr/sU1racHeo+FJeOgTGdUeJHAXuDdDBirIOe7KNfsgE54UM7sK UL6jLQFZkepRwDKZz80O+jKU8EaELoF8aNIYq5XvgUMvgJ/R+5NGk9kpOyO9wMQNLT Gl6MJavgc6rY5sYVd3mVpBm7s0X4GjAq5L9fX0ZU= Date: Tue, 14 Jun 2022 16:37:56 +0200 From: Greg KH To: Zhi Song Cc: rafael@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] node: put_device after failing to device_register Message-ID: References: <20220614143007.1730171-1-zhi.song@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220614143007.1730171-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:30:07PM +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. the device is not being freed, why say this? And you do have a full 72 columns to use :) > > We should use put_device() to give up the reference > initialized in this function instead. There is no "instead" happening here. The patch looks correct, but this changelog text does not. Please fix up. thanks, greg k-h