From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DE09399350; Thu, 30 Jul 2026 15:14:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785424450; cv=none; b=DdxeIfkN9x6q9Y0u17l65tVLNtWM0nAf+whMQm9mLMG1a6L4hRstiFcTrbrai2SSThLKvfIyEOBXS0BLI914cs8iSzV2suzvkEpZZCIdCfPXPTWd+31+MXiQ3S5Qy/OWpiIhacJjtO5qyYBJKfLoHCrLHPpYfgBHGsCIzbjxSjU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785424450; c=relaxed/simple; bh=I7FHuOA1i/0NcLlAY5aSYr746SBewRc3Oycyvqm/zOM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EnPOgbC0pWK91an/dz2Wh6E3SMGgbll27v7ixaGRAzUJMdQwsT0PfcJu5E1J2FzH3Z31Nzk3xWPFV8oZB3t4MVctF2BUn9bBk+Cs/3v2zfsPIbyHF6fZbruzPTE0O8DkbZxScBWCQyIn8sweuc+1wvCCIsYG6HayeXwI8lDIOxs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=bW6sEW2t; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="bW6sEW2t" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D88701F000E9; Thu, 30 Jul 2026 15:14:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785424449; bh=jEwu9CPK/vPKk397I55cmOiHC/AyvXIK9rBl3QpJ9+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bW6sEW2tjBT+cUSgAhPIa+ACZcskek2S92g3Du6W/TUkUYxAZdu27xdtsHvVHFXav 2EImeCa0brH6GRjC+DfQyjEL1X33IOPIo1SzzXvRQEU4sMtNEmN77wjOuyxMagWSf2 ZBjYIZsWDTMKxdxD38kOSKJx+4wUecDHqq9RazfA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Myeonghun Pak , Hans Verkuil Subject: [PATCH 6.18 397/675] media: cec: seco: unregister adapter on IR probe failure Date: Thu, 30 Jul 2026 16:12:07 +0200 Message-ID: <20260730141453.570874673@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141445.110192266@linuxfoundation.org> References: <20260730141445.110192266@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Myeonghun Pak commit c3a78691be8245e52ced489f268e413f18061ac2 upstream. If secocec_ir_probe() fails after cec_register_adapter() succeeds, probe returns an error and the driver remove callback is not called. The current unwind path unregisters the notifier and then falls through to cec_delete_adapter(), which violates the CEC adapter lifetime rules after a successful registration. Add a registered-adapter unwind path that unregisters the notifier and the adapter instead. Fixes: daef95769b3a ("media: seco-cec: add Consumer-IR support") Cc: stable@vger.kernel.org Signed-off-by: Myeonghun Pak Signed-off-by: Hans Verkuil Signed-off-by: Greg Kroah-Hartman --- drivers/media/cec/platform/seco/seco-cec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/media/cec/platform/seco/seco-cec.c +++ b/drivers/media/cec/platform/seco/seco-cec.c @@ -649,7 +649,7 @@ static int secocec_probe(struct platform ret = secocec_ir_probe(secocec); if (ret) - goto err_notifier; + goto err_unregister_adapter; platform_set_drvdata(pdev, secocec); @@ -657,6 +657,10 @@ static int secocec_probe(struct platform return ret; +err_unregister_adapter: + cec_notifier_cec_adap_unregister(secocec->notifier, secocec->cec_adap); + cec_unregister_adapter(secocec->cec_adap); + goto err; err_notifier: cec_notifier_cec_adap_unregister(secocec->notifier, secocec->cec_adap); err_delete_adapter: