From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57B08EB64D9 for ; Thu, 15 Jun 2023 17:31:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229665AbjFORbP (ORCPT ); Thu, 15 Jun 2023 13:31:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229629AbjFORbO (ORCPT ); Thu, 15 Jun 2023 13:31:14 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15611171F; Thu, 15 Jun 2023 10:31:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686850274; x=1718386274; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=83wWVQfLz1m9xirpCsvcg65m3Ddj7atESArkTnfXNKI=; b=hkCxQoPvIGQZcd5WnmQsXbZHvQ615Q4Uu6Q6exLAbCWvfOh9XrbByB84 A6C5+PtZ6oa0Q0w6swehVtHRkKSNkf1yuM59jigAG7ihQ8E5xnZA6WSlB HYqgaNrxgUD3ivWtC0xgXAlUsr+KL/h5ifxM2ypQYXsMAMsPdL6VSHZ1z fh2Td1ByHDtpjQTBvMCDueHj4hU9FSoeO6nbtysqCD8L2q62M0SIbD+F6 LNzwp5O0ovh50JUafhwZnQHhG3YOIrUYjW7VnEXJeLjkVKzOi8Tz9h3gB 2rY1aM6+k/kTzvUd0bBXKFV4euIRktYBPN4Nxru3MSumm7/3XhdboYWc1 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10742"; a="362402335" X-IronPort-AV: E=Sophos;i="6.00,245,1681196400"; d="scan'208";a="362402335" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2023 10:20:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10742"; a="662864086" X-IronPort-AV: E=Sophos;i="6.00,245,1681196400"; d="scan'208";a="662864086" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga003.jf.intel.com with ESMTP; 15 Jun 2023 10:20:37 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1q9qeC-003zpu-1p; Thu, 15 Jun 2023 20:20:36 +0300 Date: Thu, 15 Jun 2023 20:20:36 +0300 From: Andy Shevchenko To: Rob Herring Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Frank Rowand Subject: Re: [PATCH v1 1/1] of/platform: Propagate firmware node by calling device_set_node() Message-ID: References: <20230615145243.37095-1-andriy.shevchenko@linux.intel.com> <20230615164452.GA1166619-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Thu, Jun 15, 2023 at 08:13:52PM +0300, Andy Shevchenko wrote: > On Thu, Jun 15, 2023 at 10:44:52AM -0600, Rob Herring wrote: > > On Thu, Jun 15, 2023 at 06:03:52PM +0300, Andy Shevchenko wrote: > > > On Thu, Jun 15, 2023 at 06:01:17PM +0300, Andy Shevchenko wrote: > > > > On Thu, Jun 15, 2023 at 05:59:52PM +0300, Andy Shevchenko wrote: > > > > > On Thu, Jun 15, 2023 at 05:52:43PM +0300, Andy Shevchenko wrote: ... > > > > > in the code which seems to me problematic in two ways: > > > > > 1) (minor) the dev_set_name() may fail, no checks are there; > > > > Is there anything besides a memory alloc failure? What will print a > > message already. Wouldn't we fail a bit later on when adding the > > device anyways? > > I don't see how we fail. Any pointers? Okay, code in question: /* subsystems can specify simple device enumeration */ if (!dev_name(dev) && dev->bus && dev->bus->dev_name) dev_set_name(dev, "%s%u", dev->bus->dev_name, dev->id); if (!dev_name(dev)) { error = -EINVAL; goto name_error; } -- With Best Regards, Andy Shevchenko