Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1259035 > unrolled thread
| Started by | Vincent Stehlé <vincent.stehle@laposte.net> |
|---|---|
| First post | 2015-10-29 23:10 +0100 |
| Last post | 2015-10-30 12:40 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] ASoC: Intel: Skylake: fix typo in sizeof Vincent Stehlé <vincent.stehle@laposte.net> - 2015-10-29 23:10 +0100
Re: [PATCH] ASoC: Intel: Skylake: fix typo in sizeof Mark Brown <broonie@kernel.org> - 2015-10-30 04:10 +0100
Re: [PATCH] ASoC: Intel: Skylake: fix typo in sizeof Vinod Koul <vinod.koul@intel.com> - 2015-10-30 12:40 +0100
| From | Vincent Stehlé <vincent.stehle@laposte.net> |
|---|---|
| Date | 2015-10-29 23:10 +0100 |
| Subject | [PATCH] ASoC: Intel: Skylake: fix typo in sizeof |
| Message-ID | <qp3yp-5XB-1@gated-at.bofh.it> |
The size of the pointer to a data structure to send is erroneously
passed to sst_ipc_tx_message_wait() as its tx_bytes argument. It should
be given the size of the pointed skl_ipc_dxstate_info structure instead.
Coincidentally, both the pointer and the structure have the same size of
8 bytes on a 64 bit machine, which "masks" the issue. Compiling for 32
bit reveals the issue more clearly.
Fix the typo for correctness, and to make the code robust to future
evolutions of the skl_ipc_dxstate_info structure size.
This fixes the following coccicheck error:
sound/soc/intel/skylake/skl-sst-ipc.c:641:8-14: ERROR: application of sizeof to pointer
Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
Cc: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Cc: Jeeja KP <jeeja.kp@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: trivial@kernel.org
---
sound/soc/intel/skylake/skl-sst-ipc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/intel/skylake/skl-sst-ipc.c b/sound/soc/intel/skylake/skl-sst-ipc.c
index 937a0a3..9aee835 100644
--- a/sound/soc/intel/skylake/skl-sst-ipc.c
+++ b/sound/soc/intel/skylake/skl-sst-ipc.c
@@ -638,7 +638,7 @@ int skl_ipc_set_dx(struct sst_generic_ipc *ipc, u8 instance_id,
dev_dbg(ipc->dev, "In %s primary =%x ext=%x\n", __func__,
header.primary, header.extension);
ret = sst_ipc_tx_message_wait(ipc, *ipc_header,
- dx, sizeof(dx), NULL, 0);
+ dx, sizeof(*dx), NULL, 0);
if (ret < 0) {
dev_err(ipc->dev, "ipc: set dx failed, err %d\n", ret);
return ret;
--
2.6.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Date | 2015-10-30 04:10 +0100 |
| Message-ID | <qp8eK-oK-1@gated-at.bofh.it> |
| In reply to | #1259035 |
[Multipart message — attachments visible in raw view] — view raw
On Thu, Oct 29, 2015 at 11:04:41PM +0100, Vincent Stehlé wrote: > The size of the pointer to a data structure to send is erroneously > passed to sst_ipc_tx_message_wait() as its tx_bytes argument. It should > be given the size of the pointed skl_ipc_dxstate_info structure instead. This was reported by 0 day, please don't ignore reports from 0 day. > Cc: trivial@kernel.org This doesn't look like a trivial fix...
[toc] | [prev] | [next] | [standalone]
| From | Vinod Koul <vinod.koul@intel.com> |
|---|---|
| Date | 2015-10-30 12:40 +0100 |
| Message-ID | <qpgch-5f8-3@gated-at.bofh.it> |
| In reply to | #1259182 |
[Multipart message — attachments visible in raw view] — view raw
On Fri, Oct 30, 2015 at 12:02:58PM +0900, Mark Brown wrote: > On Thu, Oct 29, 2015 at 11:04:41PM +0100, Vincent Stehlé wrote: > > The size of the pointer to a data structure to send is erroneously > > passed to sst_ipc_tx_message_wait() as its tx_bytes argument. It should > > be given the size of the pointed skl_ipc_dxstate_info structure instead. > > This was reported by 0 day, please don't ignore reports from 0 day. I usually do keep track of any issues reported by 0day, must have missed this one then. Will check if any other issue was reported.. I know one issue at least for which we have a patch, will send that out as well -- ~Vinod
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web