From nobody Mon Sep 28 04:56:12 2026 Received: from cmccmta6.chinamobile.com (cmccmta6.chinamobile.com [111.22.67.139]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 100F43BC68E for ; Wed, 26 Aug 2026 09:27:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=111.22.67.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787736447; cv=none; b=sqdGLNYQEWrBrXAj3jtZYmcckvpu08llQXczAML8U6/rpdjyJLl/omfi2hq5wldQBnssIbCCOk+nL2FrcJRde22jaNyuRW4tc36rM5dQqhiAESKYx07WfxHuCF1Qtx6MdAK/OkGLB624Tzi74yh5RHDgIEPUp7j9pExpngtQ4SQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787736447; c=relaxed/simple; bh=wIOrCmV0Rpqh32A9GsECAiD4TU7eNyI8NrjWmhn2Uuc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=PMh5CmgWXjRs76FA1o4HWWJpM5LpS5odm1MFgJLLapiHp++Qq1S497OC+xjhztR51REGbN259EFPErcHME7dTUqfETkC3mztd4vbkmfSQkrMJgM90bgko9eGRJ/2As5V87h3zAHAeIJ5aW29GXFp4PFmdrqHrdwfFCGT28FPuX0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmss.chinamobile.com; spf=pass smtp.mailfrom=cmss.chinamobile.com; dkim=pass (1024-bit key) header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.b=Ahjjxku7; arc=none smtp.client-ip=111.22.67.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmss.chinamobile.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmss.chinamobile.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.b="Ahjjxku7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmss.chinamobile.com; s=default; l=0; h=from:subject:message-id:to:cc:mime-version; bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=; b=Ahjjxku7T8xydR0zzSix4LK9YvnNhSIMULVfmu4JP+pwErNg1kzImKVvEuTDK2sw8wFadQaSW4mIg MbhZr/pRVQfky4EDMksdaKJSXFu9LiJrxU5KFAEIuxfMsvWpITJG7i5+CsbvRv7cJ8i6gDqYywB37k HCphiMX7cA7URPAk= X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from spf.mail.chinamobile.com (unknown[10.188.0.87]) by rmmx-syy-dmz-app05-12005 (RichMail) with SMTP id 2ee56a8eb0bd4f5-68a4b; Wed, 26 Aug 2026 17:24:14 +0800 (CST) X-RM-TRANSID: 2ee56a8eb0bd4f5-68a4b X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from Z04181454368174 (unknown[36.137.216.22]) by rmsmtp-syy-appsvr07-12007 (RichMail) with SMTP id 2ee76a8eb0bb2c6-faca3; Wed, 26 Aug 2026 17:24:14 +0800 (CST) X-RM-TRANSID: 2ee76a8eb0bb2c6-faca3 From: zhangjiao2 To: dmitry.baryshkov@oss.qualcomm.com Cc: andersson@kernel.org, kuba@kernel.org, daniel.lezcano@oss.qualcomm.com, kees@kernel.org, trivial@kernel.org, linux-kernel@vger.kernel.org, zhang jiao Subject: [PATCH] samples: qmi: Fix decoded_size for the ping response handler Date: Wed, 26 Aug 2026 17:24:07 +0800 Message-ID: <20260826092408.3224-1-zhangjiao2@cmss.chinamobile.com> X-Mailer: git-send-email 2.50.1.windows.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 Content-Type: text/plain; charset="utf-8" From: zhang jiao The ping response message handler decodes TEST_PING_REQ_MSG_ID_V01 responses using test_ping_resp_msg_v01_ei and forwards the decoded message to ping_pong_cb(), which casts the data to struct test_ping_resp_msg_v01. However, decoded_size was wrongly set to sizeof(struct test_ping_req_msg_v01), the request message. Use sizeof(struct test_ping_resp_msg_v01) instead so the QMI core allocates a buffer matching the response structure that is being decoded. Signed-off-by: zhang jiao --- samples/qmi/qmi_sample_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/qmi/qmi_sample_client.c b/samples/qmi/qmi_sample_clien= t.c index 247ec5e54c4f..94173b82ae31 100644 --- a/samples/qmi/qmi_sample_client.c +++ b/samples/qmi/qmi_sample_client.c @@ -434,7 +434,7 @@ static const struct qmi_msg_handler qmi_sample_handlers= [] =3D { .type =3D QMI_RESPONSE, .msg_id =3D TEST_PING_REQ_MSG_ID_V01, .ei =3D test_ping_resp_msg_v01_ei, - .decoded_size =3D sizeof(struct test_ping_req_msg_v01), + .decoded_size =3D sizeof(struct test_ping_resp_msg_v01), .fn =3D ping_pong_cb }, {} --=20 2.33.0