Takashi Iwai 7c674e
From eb100b8fa8e8b59eb3e5fc7a5fd4a1e3c5950f64 Mon Sep 17 00:00:00 2001
Takashi Iwai 7c674e
From: Mika Westerberg <mika.westerberg@linux.intel.com>
Takashi Iwai 7c674e
Date: Fri, 29 Apr 2022 17:10:17 +0300
Takashi Iwai 7c674e
Subject: [PATCH] thunderbolt: Use the actual buffer in tb_async_error()
Takashi Iwai 7c674e
Git-commit: eb100b8fa8e8b59eb3e5fc7a5fd4a1e3c5950f64
Takashi Iwai 7c674e
Patch-mainline: v6.0-rc4
Takashi Iwai 7c674e
References: git-fixes
Takashi Iwai 7c674e
Takashi Iwai 7c674e
The received notification packet is held in pkg->buffer and not in pkg
Takashi Iwai 7c674e
itself. Fix this by using the correct buffer.
Takashi Iwai 7c674e
Takashi Iwai 7c674e
Fixes: 81a54b5e1986 ("thunderbolt: Let the connection manager handle all notifications")
Takashi Iwai 7c674e
Cc: stable@vger.kernel.org
Takashi Iwai 7c674e
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Takashi Iwai 7c674e
Acked-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai 7c674e
Takashi Iwai 7c674e
---
Takashi Iwai 7c674e
 drivers/thunderbolt/ctl.c | 2 +-
Takashi Iwai 7c674e
 1 file changed, 1 insertion(+), 1 deletion(-)
Takashi Iwai 7c674e
Takashi Iwai 7c674e
diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
Takashi Iwai 7c674e
index e5ede5debfb0..0c661a706160 100644
Takashi Iwai 7c674e
--- a/drivers/thunderbolt/ctl.c
Takashi Iwai 7c674e
+++ b/drivers/thunderbolt/ctl.c
Takashi Iwai 7c674e
@@ -407,7 +407,7 @@ static void tb_ctl_rx_submit(struct ctl_pkg *pkg)
Takashi Iwai 7c674e
 
Takashi Iwai 7c674e
 static int tb_async_error(const struct ctl_pkg *pkg)
Takashi Iwai 7c674e
 {
Takashi Iwai 7c674e
-	const struct cfg_error_pkg *error = (const struct cfg_error_pkg *)pkg;
Takashi Iwai 7c674e
+	const struct cfg_error_pkg *error = pkg->buffer;
Takashi Iwai 7c674e
 
Takashi Iwai 7c674e
 	if (pkg->frame.eof != TB_CFG_PKG_ERROR)
Takashi Iwai 7c674e
 		return false;
Takashi Iwai 7c674e
-- 
Takashi Iwai 7c674e
2.35.3
Takashi Iwai 7c674e