From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 74F4A37F313 for ; Sun, 26 Jul 2026 09:31:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785058296; cv=none; b=kaUdxRguNi2HlFBgNU8pFxtaDSO5lovpEDzn3blutgorUf4GM0jOzv6yPvEJLDQtMyPpaTvCMGDP08OOSmBHbWXKk2UD6AlbVIilXEuLaRCKJbBFFhveXC9LQOW7uP/rmENPIWffjtIOrlP4C/TIFHSFyNWnR2iHH/fHCXqC3Uw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785058296; c=relaxed/simple; bh=u7REdmmpuX4Q8U4G/vc9BgFz8IOFsGkTYQ2px+ZknCg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ILvqMkAIHvEzWjuWMUpWKrTI3QH8THCPmJenwoMizTw/I3/abiSWUL5Wxw6vvKHic6gbBJ/1C6bXjigy5Ap/SkymfGIE23vOmnppQKkThSbDDPgFbyqYhGO6ICO4scMzDZcWQO5SdAXWzRW0sPHlisoSSE0NjlN+LvH/bPSNR9c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AoonPlg8; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AoonPlg8" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2cc7e86e7aeso18705285ad.2 for ; Sun, 26 Jul 2026 02:31:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785058295; x=1785663095; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=3lLDZViLAfINHg50NTNYlWjUmmq7rCNRpyVHV83r/TA=; b=AoonPlg8m/+dMnN3MLWGQFNNQ2zQ1AVB473XQvMXktDQX/CRzF0UOLqDorDZ9jLjLY aegmUrT44HtGrP1Rl75YbaisGUckFvxzqANBUN12qqp0Y7ZUa/SGSJ42QKdLohglgn5C +t17Qg2Akuqw6elBBp9vW0jXke1yH0E4BWgNP4/yOvP6itgWVgBRlb+Q6gO2T5Pe3KtH puoyiQlJjNjfFwegraq4QR3PdjzxTwkWb52QbUSYasrVpEBHnetb+/ArmFX/OiTvTgQZ tLOCyocd1cVdcMH98XlZ3bez/Qw4ZEeiOkMSQvCfa6aID+15bxNAswgvIpJs215evBYJ R0uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785058295; x=1785663095; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=3lLDZViLAfINHg50NTNYlWjUmmq7rCNRpyVHV83r/TA=; b=Tg1DSqLVpYnaVW0f8B0wRZlUn6WuauPkfjyeQL1/V6fmOtQWeZEVApvCXiS8MahC2t ZTPZbM3eMlmybtgPItWWvDt4HD2+7m2z8vXl2pyV2dNutSAznVUyk0stHhh4Q2Yy/vbe Iz2tpr0Spo0dWKNqZxTN1QECL8Mw53CxG0HxGiJJEoAs3RDQcK4NSvXX1dKXzpY7MAhQ i/YCNUWA7GHKpDTu+Q/A+LDMDxYJygboj+652IFhgIQOU5RG0pkAHH6NjZQUyP/e7SAB hGscUl33M0/QkKhwFDrmDyWVHTctjOOHzGSvQbHHALwtpR1nMfZlJr8uExLrOwzGYltc Dgig== X-Forwarded-Encrypted: i=1; AHgh+RrhIvNgXKx9p2a9pj5qUDrkMD6RPsvJ1CaWNEmo9vci44ixmeYblF7Y7XLhsJLlh+Q+h9Nz4IJxq4z77PM=@vger.kernel.org X-Gm-Message-State: AOJu0YyzWXtOegeXVQjsjcn3OwMr6JCpdMUT3yIO/2MDjqXiw9YEPeip 5Fsss/dR3GEXJVrQB7oSlU8zytPU0oaFpdV4PsOu1qoDV7EsW08E7qjG X-Gm-Gg: AR+sD130sVUy8xNt3/1L9H6TLxGo5w57eLU5Z84UUjo/OUUmEmdrk23f535VrLBYkmd sYaE8F/XnXJm8icW4lEBn037IZeitM6VNHsS9mJUwGKcnr1x3IjjqO51MM2pLs/+TtUrRQ9DEVO gAj908lOLyiwdWR9AkhI4yDuLstvJZPOhB+MkcAUD+tLChtJkb5aCGqO6Eh240fHXCI1i5Z+meE Qe9RipBBGAfZsWL+ZjxssyaJ/iCL5pnjcO0/AXxJcbqjxQwZ1HH9WPhIFSfjP1Cc8eAqSS7KAfo enXxJmF3T3wkeVSJu1QW1wpArtY0KDGafNEUL7pj2THM+RG6jWPOdWi2s5gyxhWMpNi1Z64s0nR vUSUY1T4G1Tm5ouCltuNLjhs1TbWb15XHOu13sr7F3JLgQEbIL4WobqLP/vq/iFPU+wnZDxMvOC A4dv5vpipf/6QN X-Received: by 2002:a17:902:cecc:b0:2c9:97a7:f544 with SMTP id d9443c01a7336-2cfde888049mr41374305ad.42.1785058294646; Sun, 26 Jul 2026 02:31:34 -0700 (PDT) Received: from ubuntu.. ([2001:2d8:72ac:5ae4:b4c0:11d6:e62a:f791]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cfde7ee3b1sm17860305ad.62.2026.07.26.02.31.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jul 2026 02:31:33 -0700 (PDT) From: Rihyeon Kim To: =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= Cc: bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, tarunsahu@google.com, djeffery@redhat.com Subject: Re: [PATCH] PCI: Handle dev_set_name() failure in pci_setup_device() Date: Sun, 26 Jul 2026 18:31:27 +0900 Message-ID: <20260726093127.145865-1-rihyeon8648@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260725180429.GA349362@rocinante> References: <20260725180429.GA349362@rocinante> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hello, Thanks a lot for the review. > The kernel-doc for pci_setup_device() will probably need to be updated to > reflect changes in what the function returns on failure, since now you have > the -EIO and also -ENOMEM, potentially. Good point, I missed that. Updated in v2. > Probably: > > Fixes: 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array") > > The commit you have references a state of the code, a much older code base, > where the implementation was fundamentally different, per: You are right, thanks. I had missed that dev_set_name() could not fail at all back then, and that the commit I picked was only replacing an snprintf() into the same fixed array. Both patches in v2 use 1fa5ae857bb1 now, and the commit log says kvasprintf_const(). > The fix there is valid and would be nice to also pick it up. Might use > a little... > > dev->dev.kobj.name = NULL; > > After the kfree_const(). > > Feel free to pick it up, and include here as a second patch, so a small > series. Don't forget to credit Yang Yingliang, if you do decide to > follow-up. Thanks for the suggestion. It is patch 2/2 in v2, with the NULL assignment as you described, and with Suggested-by: and a Link: to Yang Yingliang's original posting. > This one I am not sure. The NULL-assignment move looks awkward there. Agreed, I left pci_device_add() alone. It also overlaps with the driver core series that changes when device_add() frees dev->p [1], so I would rather wait and see how that one settles before proposing anything there. If it still looks worth doing afterwards, I can revisit it then. [1] https://lore.kernel.org/all/20260716230411.2767394-2-tarunsahu@google.com/ Thanks again, Rihyeon