From nobody Thu Aug 13 09:23:42 2026 Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.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 8D32F36C9D0 for ; Fri, 7 Aug 2026 03:23:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786073014; cv=none; b=LDEq7irUvrxNPdgkUwmL9CQCerVbJYpZ1XiEJ7gmoR85WDZBOpjOmq6qlx+FOwweXWCr11vIajuLFwC4I2cmLrAMBq0cAOEMO5vB391MbzKvJzGFxKitLdbefObUD8IwhWFdeKJJxOgruZ4y7X6b6gpVCd6tbrAdJizTEAFTh6w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786073014; c=relaxed/simple; bh=0S8SD3Czp4VjWWDV7Rb3OfeQLCvGoJTuAcV/rwCFNtw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pu48pdZsq9Jmsb5AWTG23kStD8I6aKnydGIoHx1HwU8lZR55M/8pazhlFh9lZ/ydqcbD0Qp1HJeAnIQqAaWiPlnKE5HBLKPThzTyvNUx4GF4p7Ng0YOcTE4wyuOCJh3ribvQxNAPEtLYxe4oPSO7yJ7Rvzqgbjf0zb9pUM1vBRw= 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=UbZb7lbm; arc=none smtp.client-ip=209.85.160.181 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="UbZb7lbm" Received: by mail-qt1-f181.google.com with SMTP id d75a77b69052e-52b4e988c77so19005501cf.3 for ; Thu, 06 Aug 2026 20:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786073012; x=1786677812; 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:content-type; bh=T5tWYfkrSYEAFJzgjYou2Lj+31bzExLORMbEtdMFcLw=; b=UbZb7lbmdquEtIfS3FFBN5lAJp1rSXX78jgsPGCffoPbl3AHvv1lxdacElsOrfORAJ MzoRWK5JSlUui7/x5M7nUlpCzpIIK46U4DkbazIhfDIstbmT/d5VgbIhUKBeACfk8IIb XAnReaBYwZbXm5qeo1lvbBQKq3dMYJy6Se+bWaG7t5ViozDIaWXNcXP2SowTRWNp6P4t p9e5ASPomfukBNCVM4GMNBExF1o/GAzF/SfcyMAZIzEcYaqsinFWETPZUjVzBb2WpUaA aeWx3jyskayAUiw7TFAcS0fGYeii0cmlEgslgE+9pUkT6V109XCkxsGZJeZknh/ygleo 07Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786073012; x=1786677812; 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:content-type; bh=T5tWYfkrSYEAFJzgjYou2Lj+31bzExLORMbEtdMFcLw=; b=qyH3NCy/bJTrw5Nf04FV6Mkd43jcxfsSa/hYP6tYXSDY5nsQk0J4xNGUEqK21EBBEl WT5D93LOk/ZZ+mL4Fe8nWwbcHNTtJOscBlAxXzJaJ5JlX8BRF2vxXZN1JUS9jtl1vgb4 ydGzEG/IJE8Ydw7VR2UspF4W6TwnRTHaZKyT0NezYYmXei99UVposiitYb7PeHJdpSOP bbwAYJAv+cwAPr1Ttk3BnYEFfrP48mLg9MR5wlPNCWwrv+tX6RLgxxPsWi4VxwfYH8Sw jqIFbFHwhI7MhUsNAzgtrOfwfQoai77vmxQlzZJ0WXK/p0x/J1gybrWyJaBUsaLH4Kfd 6NPw== X-Forwarded-Encrypted: i=1; AHgh+Ro5jLFdr7Cz5Hgnk0JkotkaiFVe1m5Igowpu1rRMsVBpSKGPXBTbGv4Jf0nuswJke/gSdz/pIBAAOSnmRE=@vger.kernel.org X-Gm-Message-State: AOJu0YzW5UyzWG4oJK5qbbAPN8nLLg7eSrTfcKHFyEzZwRlq+9GsYdZA n3udO6pIvaTrfqqiqNjU+5SuEbGQ5m2JqKEiGFEPMUQLQ1bBmbA6n0iI X-Gm-Gg: AR+sD11BXVKx+EiItQOBeAKKAXBEMbRQ4R2ITUS8D/hhP/+lw0Y+Xo5edsKINP3m3Ej bYCem07QFI8XFCWRkpEG9DxboKoYGeQm9aLM8u6IM/4TWvjRbgH5myqF+1w5a1PuecDGOvtV8jF iMbOXmXYALb+U1Lz3zwKxRJ+c5VMg1/hudZPyCTg1sfUwvEep/BHGgB/VBdyoDWQ+IO/fdW6ljB Tq6UY8yozsHamIhQGiwjMQu0W6pxKVChvWP+CZFTq/5oARA/Cb4w3vm7nkckUHAr5ZgaFnsj99g 1mgfufBolMr5SCHd+qPjNyKvUHQ6xrq+M08psuwLgkM/4myw093GxYNhwKFt8h6rljsHBYe0Enf rqa/YSsFE2QYv0HvZNGMw7zwGNh/XnokLGG3S0XFtcpOUJSRPp35CtWyHjlfXarblUzanoCu1+u HnQZGRxGk3+z7jb3WFcLQ7CFfrZ9voeGDbnMUC8xlWvRekGZ81/OBH8N4SJbpIeRvY0GZVIDTOP HhyhEBo3oy4C3OB1bNBauObZR+Av+9S+AzRovwINRMmmaQmW0drJDdUjGaySAE= X-Received: by 2002:a05:622a:8cb:b0:51c:d1c:10e3 with SMTP id d75a77b69052e-52ce619a1c0mr217368161cf.35.1786073012343; Thu, 06 Aug 2026 20:23:32 -0700 (PDT) Received: from i4-gl-tmk5904.ad.psu.edu ([130.203.156.186]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-52d1663e9e1sm3438561cf.30.2026.08.06.20.23.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2026 20:23:31 -0700 (PDT) From: Yuho Choi To: jgross@suse.com Cc: sstabellini@kernel.org, oleksandr_tyshchenko@epam.com, thorsten.blum@linux.dev, jason.andryuk@amd.com, alhouseenyousef@gmail.com, kees@kernel.org, darwi@linutronix.de, jpoimboe@kernel.org, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, alhouseenyoursef@gmail.com, Yuho Choi Subject: [PATCH v1] xenbus: Unregister reboot notifier on init failure Date: Thu, 6 Aug 2026 23:23:26 -0400 Message-ID: <20260807032326.940377-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" xs_init() registers xs_reboot_nb before initializing XenStore communications and starting xenwatch. If either operation fails, the notifier remains registered and a later initialization attempt can hit a duplicate registration. Check the notifier registration result and unregister it on every subsequent failure path. Fixes: fd8aa9095a95 ("xen: optimize xenbus driver for multiple concurrent x= enstore accesses") Signed-off-by: Yuho Choi --- drivers/xen/xenbus/xenbus_xs.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index d1cca4acb6f3..62274d377b3a 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c @@ -915,19 +915,27 @@ int xs_init(void) int err; struct task_struct *task; =20 - register_reboot_notifier(&xs_reboot_nb); + err =3D register_reboot_notifier(&xs_reboot_nb); + if (err) + return err; =20 /* Initialize the shared memory rings to talk to xenstored */ err =3D xb_init_comms(); if (err) - return err; + goto err_unregister_reboot_notifier; =20 task =3D kthread_run(xenwatch_thread, NULL, "xenwatch"); - if (IS_ERR(task)) - return PTR_ERR(task); + if (IS_ERR(task)) { + err =3D PTR_ERR(task); + goto err_unregister_reboot_notifier; + } =20 /* shutdown watches for kexec boot */ xs_reset_watches(); =20 return 0; + +err_unregister_reboot_notifier: + unregister_reboot_notifier(&xs_reboot_nb); + return err; } --=20 2.43.0