thunderbolt: Use the actual buffer in tb_async_error()
authorMika Westerberg <mika.westerberg@linux.intel.com>
Fri, 29 Apr 2022 14:10:17 +0000 (17:10 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Thu, 18 Aug 2022 08:55:46 +0000 (11:55 +0300)
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

index e5ede5d..0c661a7 100644 (file)
@@ -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;