From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) (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 62973412BF0 for ; Mon, 3 Aug 2026 15:21:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785770516; cv=none; b=M/b7v1EU+nS5n6+3soedZsvbGEMwAmNTQJ577z8nhouKoEOpHeAX0a/Omt4+1boSuxTEVpewS4eyS4XYaDg/1sPuw2FSKF+M+S/RQTe0k3WRF4f0Mf2+tCgu/2Trd+mz5981pdHuTo82AYaLxZ5QqEE+LWhUaMlAu3FC9w6C3fM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785770516; c=relaxed/simple; bh=QnuqF+lWWLDhDC7hpxABlZ6HZz+qjd2tCb+xVb/LbSo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ldCkeZaA+xvAXFOQNnP4dRq8wdnYSngQlWYxIu5puZrTZ6UVLL6P5pmaSJ8wZNK6c3+q0udRSAyd0xFROOe3Z5IgpfWqfru00tUozNVlf/TlR3DIlgRzpVE09s6e2qS7HlZOMiPGmPi3QX96pNt6F8YeQoLmz5aCvc4px0EBI6o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=minyard.net; spf=pass smtp.mailfrom=minyard.net; dkim=pass (2048-bit key) header.d=minyard.net header.i=@minyard.net header.b=LHI+cAj4; arc=none smtp.client-ip=209.85.167.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=minyard.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=minyard.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=minyard.net header.i=@minyard.net header.b="LHI+cAj4" Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-495b27007d0so1800431b6e.1 for ; Mon, 03 Aug 2026 08:21:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=minyard.net; s=google; t=1785770514; x=1786375314; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:reply-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to:content-type; bh=u3yx3TW6oyWStHbC8QlbieaT8HDIQB0jnTxW672P8Hw=; b=LHI+cAj4HSzVhHqm2WwoiF1d5nXhvJYtQpQkd8g8OdaSQD+KcOL/Ue7hPsgOdIJqkt dXgJFgrqLfjRRvRXqIeA0xSHRWtVt+wlnyyPCPZbIVw54UcWCOH18HSgAQlCkwh21w0m goX4LonsVEUJAbIZL9Y49ibaEA7NMNOdqYeyzDU0KaOuK9y4LYhQ76RVrd+lm9l7Jivh u3zDfJT2I6wSaWdc1KnPmiwl+d8AMekjtDXg9vXTEBLy8YukaDXv3An1xX9KAbhEDCnz V6sfaYKOC7RTbKvnETRZOb28JAB2aF/L51bT2qcsYed4HD5seFBpYvFAlmgaP9PQdZ2R JdgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785770514; x=1786375314; h=in-reply-to:content-disposition:content-type:mime-version :references:reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=u3yx3TW6oyWStHbC8QlbieaT8HDIQB0jnTxW672P8Hw=; b=n9KhYmaulFJvlm+Y4lNan9FSYHz2gr7G1l9G1DgD1mdjlRA45MbmNXHAmK0xpsf4a1 WkE/+YeBffK7qk+kq9yWjD5ylihkPgJBwJhAZ4mv5wCZIQb408s5NRzKdHmn6xVd58Fz fOEgCAolcoBU+LANiTuvGyrty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by 2002:a05:6808:1819:b0:495:f223:bcdb with SMTP id 5614622812f47-4af5dcbbe42mr15312319b6e.0.1785770514127; Mon, 03 Aug 2026 08:21:54 -0700 (PDT) Received: from mail.minyard.net ([2001:470:b8f6:1b:9544:19bf:6bcd:badd]) by smtp.gmail.com with ESMTPSA id 5614622812f47-4af58e95b32sm6789615b6e.10.2026.08.03.08.21.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2026 08:21:53 -0700 (PDT) Date: Mon, 3 Aug 2026 10:20:54 -0500 From: Corey Minyard To: Yuho Choi Cc: openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] ipmi: Remove all sysfs files on registration failure Message-ID: Reply-To: corey@minyard.net References: <20260803015550.618808-1-dbgh9129@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260803015550.618808-1-dbgh9129@gmail.com> On Sun, Aug 02, 2026 at 09:55:50PM -0400, Yuho Choi wrote: > ipmi_add_smi() creates the nr_users and nr_msgs files before trying to > create the maintenance_mode file. If that last creation fails, the error > path removes only nr_users before dropping the final reference to the > interface. > > Remove nr_msgs as well so no sysfs attribute embedded in the freed > interface remains registered. Thanks, this is queued for next release. I've also copied stable for a backport to 6.18. -corey > > Fixes: 627118470fcc ("ipmi: Add a maintenance mode sysfs file") > Signed-off-by: Yuho Choi > --- > drivers/char/ipmi/ipmi_msghandler.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c > index ab4c85f3d6fe..546b7ca8d68e 100644 > --- a/drivers/char/ipmi/ipmi_msghandler.c > +++ b/drivers/char/ipmi/ipmi_msghandler.c > @@ -3740,6 +3740,7 @@ int ipmi_add_smi(struct module *owner, > sysfs_attr_init(&intf->maintenance_mode_devattr.attr); > rv = device_create_file(intf->si_dev, &intf->maintenance_mode_devattr); > if (rv) { > + device_remove_file(intf->si_dev, &intf->nr_msgs_devattr); > device_remove_file(intf->si_dev, &intf->nr_users_devattr); > goto out_err_bmc_reg; > } > -- > 2.43.0 >