Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6290681rwl; Wed, 22 Mar 2023 08:45:49 -0700 (PDT) X-Google-Smtp-Source: AK7set8L3FkXBneZnQpQ/ld4dCfcUWSOh5fmNl7VCnmQo1VgvD2Q0FZmbS0vlyz7nhCZbIsBysJQ X-Received: by 2002:a17:903:2903:b0:1a1:8d4e:a70d with SMTP id lh3-20020a170903290300b001a18d4ea70dmr2723805plb.38.1679499949228; Wed, 22 Mar 2023 08:45:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679499949; cv=none; d=google.com; s=arc-20160816; b=dSikkNGCWK+ZUVsxbSMiA3fM1o12B9PepcAQWFo7Jd1WOlpF7pa130VOjyMCfLkl+5 2F7XzMEJ5Usu0rjD+mET/NQCvNjZeWqg2DxFXpPPGtYewLLsG3XjnPYdx67BQbQQ3hxo wGPR8gYAWOViB9KwD5dgHdTOBI6QgfK8+lT1EVUAiX9iD9khOb9GjyVvlQwIS7rV/ypu XV6frPJyx9l4UF5Kkn760D2YcB1sm2+cEkZNZJjCGin47vLyGN/S7hcGYz6j8G0XT3v2 T0ZdOaZ+MFnu/KVWtAlqSS5zdES7cokV+kkOAco45ZIHSoX8GyaGJdDOmDkFeX58VGmV 7WPQ== 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; bh=FyMqGn4magRjUVHM1NflMiPsPITuZikQgFYxSgAaOSU=; b=HCqdzZpxstSgjECB8YIhmf8mnsWCdJk8DI0sZ2XXrL8WPHAj3jaXsQY9eaAbSA3UC8 1JY+NRffi/5lL6v/OLyk30XmxXQrHV4nCWR8ldkF89GNv+GbYBk9wfmU5GxYHe6wumBT jhG/evZvvVnyMl3gRIZT7FC3Juzhmb20aZMftmacmzKbn6rrOam8W/G1Epygylf/DjA7 W23jatFLsSXmDNe0Or4o2kRh+9a6AqTaFJfsWXgRQKfhZVs55K6HN05/EbM7aKIwFG7+ b5D4a/z9wY6OXibFgHf4leTh/5mEUMdQCgQFu/MdllMBa70ZUtlsatPdwAadNV889MAx CiTQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x1-20020a170902ec8100b0019ca7a76d2fsi18043340plg.41.2023.03.22.08.45.36; Wed, 22 Mar 2023 08:45:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230490AbjCVPo6 (ORCPT + 99 others); Wed, 22 Mar 2023 11:44:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbjCVPo5 (ORCPT ); Wed, 22 Mar 2023 11:44:57 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C133121961; Wed, 22 Mar 2023 08:44:56 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 02261807A; Wed, 22 Mar 2023 15:44:55 +0000 (UTC) Date: Wed, 22 Mar 2023 17:44:54 +0200 From: Tony Lindgren To: Andy Shevchenko Cc: Greg Kroah-Hartman , Jiri Slaby , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH v8 1/1] serial: core: Start managing serial controllers to enable runtime PM Message-ID: <20230322154454.GN7501@atomide.com> References: <20230322111255.29827-1-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 * Andy Shevchenko [230322 14:45]: > On Wed, Mar 22, 2023 at 01:12:51PM +0200, Tony Lindgren wrote: > > + device_initialize(&sbd->dev); > > + sbd->dev.parent = parent_dev; > > + sbd->dev.bus = &serial_base_bus_type; > > + sbd->dev.release = &serial_base_release; > > + > > + if (str_has_prefix(name, "ctrl")) { > > + id = port->ctrl_id; > > + } else { > > + id = port->line; > > + sbd->port = port; > > + } > > + > > + err = dev_set_name(&sbd->dev, "%s.%s.%d", name, dev_name(port->dev), id); > > + if (err) > > + goto err_free_dev; > > + > > + err = device_add(&sbd->dev); > > + if (err) > > + goto err_put_device; > > + > > + return &sbd->dev; > > + > > +err_put_device: > > + put_device(&sbd->dev); > > > + kfree_const(sbd->dev.kobj.name); > > This is double free if not const, right? > At least that's how I read kobject_cleanup() implementation. > > Sorry I haven't paid attention to this earlier. Thanks for spotting that, will drop it. Looks like we have the name allocated by kobject_set_name_vargs(), and then kobject_cleanup() frees it. > ... > > > +/* > > + * Serial core port device driver > > + */ > > Put it on one line for now? Sure, will do. Thanks, Tony