From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (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 7B4B43E1686 for ; Fri, 14 Aug 2026 21:01:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.69 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786741273; cv=none; b=rze0LTBTl/iGaIP2fPemGjNAB2GLAQDc9RtfGsIVSEn36fIBT9hOZlS+ZMoxIza+PspW3p1evid94df83NtfWiCxQNwf80rkOXhP627ToMiNg5uZwZw/G1MNXHHF8Km+k7+q6oeln6zo/bbv1K62oeS1a5+dtSRCYCK8tAOb8zg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786741273; c=relaxed/simple; bh=yV6g7NupZHoxaf7e2SbUe0CzGThymYJ+E//K4HfymY0=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=gOpax9sb0ntiQCobiK88coPyPCpY82byqrFhnYHpEzwm188K6ZJF+FIXJHJ/7lMZFbiTsOzbm7sGI3H1HlWOPmrhsTaXQVLe2EqF4E5BdCM6/YdQ/OKv8YcQRuOKCHTD4N9aaUmjJhBkV1ZBmMhQTgXVuGF88G3qUbkSPJ3nQak= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--tarunsahu.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=IpVkD8K0; arc=none smtp.client-ip=209.85.218.69 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--tarunsahu.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="IpVkD8K0" Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-c1f548718d0so154721066b.0 for ; Fri, 14 Aug 2026 14:01:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1786741260; x=1787346060; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:mime-version:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=CpRLa2s9CCSXq/nY6RLLua2/DfHcY8vtQRcWiuG8yfo=; b=IpVkD8K0tETqpa5hB/9MDEqg+FysQOKUbm7AFp18UV4T1aPANlwI2My3TrCDhsemS5 pjbfo4SBXjggC56BoeRxkk+M0We2WUVoFRg47lCihvFypILFCn7dJ23gq3vNZ/K8lFWI NxRMVcajv2eXjkqbieEh8RACp7r0DhRWkIa2yqRk8jmX02OC881YuB5rc+BGk5rb0T5I eBmaoOGpMOdv3RK7li+DPaw3+fOdoqFCPxDd2zxXTVZio2TwYvyEsQLmQMfc0cmtjZBh zxftPD/gwOfWhXWCHV+C7o88x6A0eGaBXmBCMEQTlMdF23sdY4GYm3ec1IItwmbhLu7D DpXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786741260; x=1787346060; h=content-type:cc:to:from:subject:message-id:mime-version:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=CpRLa2s9CCSXq/nY6RLLua2/DfHcY8vtQRcWiuG8yfo=; b=RHvP0UlysyvaezEn2lbONyDLs1q8varLKHlHmU9kn+TZhZ58fSbdxOm1gxfaMAv4Y1 +ceyR4i0s/qMPXgMEFDvhjwijrW1VFE5PCqTENwfRacq4D1BSLeLEOMXC1+OpFxxrZ0q cStjHOEah2kZ9V9Hheav3QlmAX5IUt055tZJoYsnmpvwUmp3EMOdwfmr3Y9+Y6emKTAJ 6gH3yqg5rxf65RlckMJgdJNk9IeJO7GAufcdV42qE5loOCPwcKU1itZcFbza0q44aXFJ FGoCbIEA0TNh+VTA0gaIQIin9RUCcr8lOB02yn4jjteYHZnHbLnzPH3irpLUUVGvoTef S14g== X-Forwarded-Encrypted: i=1; AHgh+Rr15YEK6cJHJ5lEX50NUwOlutVOHRhpuiWeq5NghYlQJAU7IVHQIUnPcHgv4l/fh3AwI80UABGXSY0DNPo=@vger.kernel.org X-Gm-Message-State: AOJu0YzcWAO125HxYjtEVEPXH+7QTB1kuevuD+pH3Ic+Km4kX5irutkp 5ha0iNbw2jSaYBI9T2fvcWYsT+9/uYXkKfL98CPNqKoqOrhMEaP6Ibyu+zVs4dupK/AcRi/kOIv OxzDp/QIl/6tqqxa6JQ== X-Received: from ejzu7.prod.google.com ([2002:a17:906:c407:b0:c1f:4de4:c4c7]) (user=tarunsahu job=prod-delivery.src-stubby-dispatcher) by 2002:a17:907:960b:b0:c1c:28e5:652e with SMTP id a640c23a62f3a-c212a228bbfmr401758866b.25.1786741259490; Fri, 14 Aug 2026 14:00:59 -0700 (PDT) Date: Fri, 14 Aug 2026 21:00:54 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.55.0.691.gc56d675ccc-goog Message-ID: <20260814210057.4102768-1-tarunsahu@google.com> Subject: [PATCH v3 0/3] Convert manual kfree(dev) to put_device() From: Tarun Sahu To: helgaas@kernel.org, dmatlack@google.com, Nicholas Piggin , Greg Kroah-Hartman , sourabhjain@linux.ibm.com, "Christophe Leroy (CS GROUP)" , Pasha Tatashin , Russell King , radheys@amd.com, skhawaja@google.com, djeffery@redhat.com, Geoff Levand , Madhavan Srinivasan , Michael Ellerman Cc: linux-arm-kernel@lists.infradead.org, souravsgl@google.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, driver-core@lists.linux.dev, Tarun Sahu Content-Type: text/plain; charset="UTF-8" Hello, As per the kernel-doc guidelines, Devices that are tried to register with device_register or to add using device_add, must use put_device on their failure path (not kfree). This series contains 3 patches for updating such instances. Same for kobject_init_and_add or kobject_add, call kobject_put instead of kfree in case of error. V3<-V1 1. Updated the commit msg of each patch to mention about the kernel-doc guidelines. V2 <- V1 1. Removed patch [1] as it is part of another series [2] already. [1]: https://lore.kernel.org/all/20260810162814.1398016-4-tarunsahu@google.com/ [2]: https://lore.kernel.org/all/20260724171945.2812749-5-shubhrajyoti.datta@amd.com/ Tarun Sahu (3): ARM: locomo: use put_device() on device_register() failure firmware/edd: use kobject_put() on edd_device_register() failure powerpc/ps3: use put_device() on device_register() failure in ps3_system_bus_device_register arch/arm/common/locomo.c | 13 ++-- arch/powerpc/platforms/ps3/device-init.c | 83 ++++++++++++++---------- arch/powerpc/platforms/ps3/system-bus.c | 2 + drivers/firmware/edd.c | 2 +- 4 files changed, 59 insertions(+), 41 deletions(-) base-commit: ddca0cd800962b4121e5f2633005167bb6216175 -- 2.55.0.691.gc56d675ccc-goog