From nobody Mon Jun 8 09:48:25 2026 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (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 AAD453019D9 for ; Wed, 3 Jun 2026 20:47:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780519675; cv=none; b=qc/TyGGZPQrwBIYgvVNcwOtL4cogHfHcMoPTKlY9m7KLqxrJPRg55qEJuFVLuTYHTQjWDLXtzXU0R/E9AhkMSgxtXL5AFh7Nl4jpOi/OsxTDjQ4KEam1eQohIEsecjzRNreluKmaIlCvovqF9sU1Hy1pXMg1LXo5uGQU/aUx0PI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780519675; c=relaxed/simple; bh=LIxqRATNJ72fBQFHYzJm/EY0QiCHge/aJw9vbZXNsjk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hvQczLGlQ0BethfSs4SbV+oz+9wFk39P/589RFauwfAXnuXiFBY81MWutBI5KZ8WjhYHR259bRyu/ihkttItktpS3uK9qTAjZe0kkswSSDB2oZQdPg8tSKc7nLk9CovJQEYDQWhPQfa+atwe+4lYxQcpnR12OwUEMY2sq1Y8GrA= 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=RpaSoJot; arc=none smtp.client-ip=209.85.222.172 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="RpaSoJot" Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-91578c374ecso2184985a.3 for ; Wed, 03 Jun 2026 13:47:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780519674; x=1781124474; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=uN5cSlSsFmu1fB4MX4N7BjMN4TwFpgg10y85Ysy+5Xo=; b=RpaSoJotIFinVFJ2pRBCniT7zr573voT4Lx3rIFvvkKn4e4VIZInkb9QQB8MXp3G6v hdjTLeqIevtOooDY4Pfv0/DGBVRJrdlIu4xMRArcYHbfLSD1wvcKB8lMCekgNOzsUYZl SqLomHiRY5n4z9g7GLu49vdWU2fAEpnltcbUeuUddB3Sjr5Jj0BL5rSTCkTGKbIX5ixv Y0AnPAMv+PvDqsn0YO2t4IOpcz3uLL1iVlx4nJmTHzuDJIx2Udfh5wIiwbw5XHNBlCD7 FGATaZ33bSaE2nJk98huOOElzXN3b593SwlYR/yuv48c9q9clab1jz769laViqnnqIxH SDXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780519674; x=1781124474; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=uN5cSlSsFmu1fB4MX4N7BjMN4TwFpgg10y85Ysy+5Xo=; b=smbtmSKNm9ZzCtjSlQ2733FlLR0RcG5bxVByAVGQy9FgSFwy0ePRsThxQd9bMyxXok NtA32xgUbpJAFUD8EvtyufcjfxY5/82yYDd9WwcDBFliCZalfkFf76JcvVUY4WlDET7V XVNbDAD+Hi4cWCnyeMSxBh+bCicB5Kq9MEeU7JFB9p7pNxqQmCkeqz62fFZ99EG6PjnM RclJHgkM2O8BPwThVp9ts6XaaNwJPPiyxpQ5VtAW+J4s+7/RNY75LbxsGjrqCutypVTF mcNsSpXMPkCtS3y2SonwhcxmaLY+U/m5HclzvwrM3bGT/urNSrjd7nqod3PHKuHiiK1w taHQ== X-Forwarded-Encrypted: i=1; AFNElJ+lubeUu8b6bdUQX8WoesnJnNjHtaJH3SO4fbv9e2rBBdl6Htx+iiAOWaWnDe2ziY4sWAXIDHngK2BIslM=@vger.kernel.org X-Gm-Message-State: AOJu0YwCCtV0rPbeQgHOXO00/J/Pn2BU5loBBNi9P9A5J+YfNs8N8M/+ sI5d/7jW1x9mS4JgqOZIHmar4gHquuYyHHhsz9Nlzzxenw8Gr0h2KwUw X-Gm-Gg: Acq92OG/Nh1rYOsGZdpszwl0K8PIrhzMQq4j9/b1cwL8QtEgEmofx58SsJB02trumdi 3F0E41fqD/erwSuyNjKGTtXiOrPdcxwUSc4CzV+h1nL8AlG+XykGbK9TNISFjR8oxl2zx5FKfq5 S9ZIHDwraennYq3kpbXOjnNrscei6XRfhsNT8GPzu8ZUxY5NVKqra5d2Qm4Fn/yJnjvgoTg38aP BNOmh0WYt8tYtBCCquT4WvMDF4+3RXKpjuds0dEi+lfJSzbNlrwnQVeVjRboWLXzILa7gLHnpnN 3mNtCicyFDy+e+b9OR69XJDsqiKaWhAYDqb0e9AkE4Jpf1jP/KufqlWH7BlhzgwhjK2fCYL8K// FtsPRQt47/EQgUqmZ1V8jLym7XkIKMffVLAgMGCVTl7rdPpQvBr2DxBT9X28+Pj3dWNCGOZ+aox bJUzBPOZ8mVP62HTHfSOj3WiCPSAnxgMQSMj+UUgE4da/AuhcUOkc= X-Received: by 2002:a05:620a:2989:b0:915:7f42:d91 with SMTP id af79cd13be357-9158a642e0amr795141385a.8.1780519673783; Wed, 03 Jun 2026 13:47:53 -0700 (PDT) Received: from i4-gl-tmk5904.ad.psu.edu ([130.203.156.186]) by smtp.gmail.com with ESMTPSA id af79cd13be357-9158a37bcd6sm359860185a.25.2026.06.03.13.47.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 13:47:53 -0700 (PDT) From: Yuho Choi To: Borislav Petkov , Tony Luck , Michal Simek Cc: linux-edac@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Yuho Choi Subject: [PATCH v1] EDAC/synopsys: Fix cleanup on injection sysfs failure Date: Wed, 3 Jun 2026 16:47:21 -0400 Message-ID: <20260603204721.2200819-1-dbgh9129@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" edac_create_sysfs_attributes() creates inject_data_error before inject_data_poison. If the second file creation fails, the first file is left behind. The same failure path runs after edac_mc_add_mc() has registered the memory controller with the EDAC core. Jumping directly to edac_mc_free() skips edac_mc_del_mc() and leaves the registered controller state unwound incorrectly. Remove inject_data_error when inject_data_poison creation fails, and route the probe failure through edac_mc_del_mc() before freeing mci. Fixes: 1a81361f75d8 ("EDAC, synopsys: Add Error Injection support for ZynqM= P DDR controller") Signed-off-by: Yuho Choi --- drivers/edac/synopsys_edac.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c index 51143b3257de..c395a1e97a36 100644 --- a/drivers/edac/synopsys_edac.c +++ b/drivers/edac/synopsys_edac.c @@ -1120,8 +1120,10 @@ static int edac_create_sysfs_attributes(struct mem_c= tl_info *mci) if (rc < 0) return rc; rc =3D device_create_file(&mci->dev, &dev_attr_inject_data_poison); - if (rc < 0) + if (rc < 0) { + device_remove_file(&mci->dev, &dev_attr_inject_data_error); return rc; + } return 0; } =20 @@ -1431,7 +1433,7 @@ static int mc_probe(struct platform_device *pdev) if (rc) { edac_printk(KERN_ERR, EDAC_MC, "Failed to create sysfs entries\n"); - goto free_edac_mc; + goto del_mc; } } =20 @@ -1448,6 +1450,10 @@ static int mc_probe(struct platform_device *pdev) =20 return rc; =20 +#ifdef CONFIG_EDAC_DEBUG +del_mc: + edac_mc_del_mc(&pdev->dev); +#endif free_edac_mc: edac_mc_free(mci); =20 --=20 2.43.0