From: Mika Westerberg Date: Fri, 29 Apr 2022 14:10:17 +0000 (+0300) Subject: thunderbolt: Use the actual buffer in tb_async_error() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=23987d01de44507f2e322dcfc154fd64f2238927;p=linux.git thunderbolt: Use the actual buffer in tb_async_error() commit eb100b8fa8e8b59eb3e5fc7a5fd4a1e3c5950f64 upstream. 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c index 0fb5e04191e24..409ee1551a7cf 100644 --- a/drivers/thunderbolt/ctl.c +++ b/drivers/thunderbolt/ctl.c @@ -408,7 +408,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;