diff mbox series

[1/2] thunderbolt: Use the actual buffer in tb_async_error()

Message ID 20220816104059.71844-1-mika.westerberg@linux.intel.com (mailing list archive)
State Accepted
Commit eb100b8fa8e8b59eb3e5fc7a5fd4a1e3c5950f64
Headers show
Series [1/2] thunderbolt: Use the actual buffer in tb_async_error() | expand

Commit Message

Mika Westerberg Aug. 16, 2022, 10:40 a.m. UTC
The received notification packet is held in pkg->buffer and not in pkg
itself. Fix this by using the correct buffer.

Fixes: 81a54b5e1986 ("thunderbolt: Let the connection manager handle all notifications")
Cc: stable@vger.kernel.org
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/thunderbolt/ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mika Westerberg Aug. 18, 2022, 8:57 a.m. UTC | #1
On Tue, Aug 16, 2022 at 01:40:58PM +0300, Mika Westerberg wrote:
> The received notification packet is held in pkg->buffer and not in pkg
> itself. Fix this by using the correct buffer.
> 
> Fixes: 81a54b5e1986 ("thunderbolt: Let the connection manager handle all notifications")
> Cc: stable@vger.kernel.org
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Both applied to thunderbolt.git/fixes.
diff mbox series

Patch

diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
index e5ede5debfb0..0c661a706160 100644
--- a/drivers/thunderbolt/ctl.c
+++ b/drivers/thunderbolt/ctl.c
@@ -407,7 +407,7 @@  static void tb_ctl_rx_submit(struct ctl_pkg *pkg)
 
 static int tb_async_error(const struct ctl_pkg *pkg)
 {
-	const struct cfg_error_pkg *error = (const struct cfg_error_pkg *)pkg;
+	const struct cfg_error_pkg *error = pkg->buffer;
 
 	if (pkg->frame.eof != TB_CFG_PKG_ERROR)
 		return false;