From nobody Sun Feb 8 11:41:03 2026 Received: from mail-out.aladdin-rd.ru (mail-out.aladdin-rd.ru [91.199.251.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA4F75D46D for ; Sun, 11 Feb 2024 15:09:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.199.251.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707664187; cv=none; b=lhIjVEVh+ZGBWof9WadLZu7v7AqN6AYxW+v9t963EMQmdgFP0nWAxZKjjJlI3kbowygHGBc60HAFSIPbQtBiUbkTV8Y2b2RQZsOYu/o8EgjSyneE3XTqIF8JD7BPmnjXah2HEFyCCqbpxdQof8K5lJqsr7MNM7QkkMdLLhLfp3E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707664187; c=relaxed/simple; bh=oM+ZoyIjXDNRxwrDc/pX5Se6omq6E/r+S5nA28fWjWk=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Goon192eMW4T7kuPCZ3nlBOSiTXo/aWqbOx2JsGqooB9KWe04DYiX+u8wBXfcCrRYZfbmLbGeECkwi0xN8M3fLEP8I3wJyhBNg/Bq/QYA09DXT4NIyBb4e646QVZkjvlpmOV/4XtUSBY2Vkqn007qBH+LmprJ0iqCZj+ozlP02Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=aladdin.ru; spf=pass smtp.mailfrom=aladdin.ru; arc=none smtp.client-ip=91.199.251.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=aladdin.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aladdin.ru From: Daniil Dulov To: Vinod Koul CC: Daniil Dulov , Bard Liao , Pierre-Louis Bossart , Sanyog Kale , , , Subject: [PATCH] soundwire: fix double free of pointer Date: Sun, 11 Feb 2024 07:09:37 -0800 Message-ID: <20240211150937.4058-1-d.dulov@aladdin.ru> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: EXCH-2016-04.aladdin.ru (192.168.1.104) To EXCH-2016-01.aladdin.ru (192.168.1.101) Content-Type: text/plain; charset="utf-8" If sdw_ml_sync_bank_switch() returns error not on the first iteration, it leads to freeing prevously freed memory. So, set the pointer to NULL after each successful bank switch. Signed-off-by: Daniil Dulov --- drivers/soundwire/stream.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index 304ff2ee7d75..d650e6f0f8e7 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -833,6 +833,7 @@ static int do_bank_switch(struct sdw_stream_runtime *st= ream) "multi link bank switch failed: %d\n", ret); goto error; } + bus->defer_msg.msg =3D NULL; =20 if (multi_link) mutex_unlock(&bus->msg_lock); --=20 2.25.1