* [PATCH] i3c: master: require dests for read CCC commands
@ 2026-07-23 9:23 Adrian Ng Ho Yin
2026-07-23 12:37 ` Mukesh Savaliya
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Adrian Ng Ho Yin @ 2026-07-23 9:23 UTC (permalink / raw)
To: Alexandre Belloni, Frank Li, linux-i3c, linux-kernel
Cc: tze.yee.ng, lkp, Adrian Ng Ho Yin, Dan Carpenter
Read CCC commands (rnw set) always need a destination array to store
payload data. Extend the existing direct-CCC validation so cmd->dests
is guaranteed non-NULL when cmd->rnw is set.
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202607222347.TXH6r6ie-lkp@intel.com/
Signed-off-by: Adrian Ng Ho Yin <adrian.ho.yin.ng@altera.com>
---
drivers/i3c/master.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index fd3e79d10c84..0249886d319b 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -1039,7 +1039,8 @@ static int i3c_master_send_ccc_cmd_locked(struct i3c_master_controller *master,
if (!master->ops->send_ccc_cmd)
return -EOPNOTSUPP;
- if ((cmd->id & I3C_CCC_DIRECT) && (!cmd->dests || !cmd->ndests))
+ if ((cmd->rnw || (cmd->id & I3C_CCC_DIRECT)) &&
+ (!cmd->dests || !cmd->ndests))
return -EINVAL;
if (master->ops->supports_ccc_cmd &&
--
2.49.GIT
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i3c: master: require dests for read CCC commands
2026-07-23 9:23 [PATCH] i3c: master: require dests for read CCC commands Adrian Ng Ho Yin
@ 2026-07-23 12:37 ` Mukesh Savaliya
2026-07-23 18:17 ` Frank Li
2026-07-30 14:42 ` Alexandre Belloni
2 siblings, 0 replies; 4+ messages in thread
From: Mukesh Savaliya @ 2026-07-23 12:37 UTC (permalink / raw)
To: Adrian Ng Ho Yin, Alexandre Belloni, Frank Li, linux-i3c, linux-kernel
Cc: tze.yee.ng, lkp, Dan Carpenter
On 7/23/2026 2:53 PM, Adrian Ng Ho Yin wrote:
> Read CCC commands (rnw set) always need a destination array to store
> payload data. Extend the existing direct-CCC validation so cmd->dests
> is guaranteed non-NULL when cmd->rnw is set.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Closes: https://lore.kernel.org/r/202607222347.TXH6r6ie-lkp@intel.com/
> Signed-off-by: Adrian Ng Ho Yin <adrian.ho.yin.ng@altera.com>
> ---
> drivers/i3c/master.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
Acked-by: Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i3c: master: require dests for read CCC commands
2026-07-23 9:23 [PATCH] i3c: master: require dests for read CCC commands Adrian Ng Ho Yin
2026-07-23 12:37 ` Mukesh Savaliya
@ 2026-07-23 18:17 ` Frank Li
2026-07-30 14:42 ` Alexandre Belloni
2 siblings, 0 replies; 4+ messages in thread
From: Frank Li @ 2026-07-23 18:17 UTC (permalink / raw)
To: Adrian Ng Ho Yin
Cc: Alexandre Belloni, Frank Li, linux-i3c, linux-kernel, tze.yee.ng,
lkp, Dan Carpenter
On Thu, Jul 23, 2026 at 05:23:10PM +0800, Adrian Ng Ho Yin wrote:
> Read CCC commands (rnw set) always need a destination array to store
> payload data. Extend the existing direct-CCC validation so cmd->dests
> is guaranteed non-NULL when cmd->rnw is set.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Closes: https://lore.kernel.org/r/202607222347.TXH6r6ie-lkp@intel.com/
> Signed-off-by: Adrian Ng Ho Yin <adrian.ho.yin.ng@altera.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/i3c/master.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index fd3e79d10c84..0249886d319b 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
> @@ -1039,7 +1039,8 @@ static int i3c_master_send_ccc_cmd_locked(struct i3c_master_controller *master,
> if (!master->ops->send_ccc_cmd)
> return -EOPNOTSUPP;
>
> - if ((cmd->id & I3C_CCC_DIRECT) && (!cmd->dests || !cmd->ndests))
> + if ((cmd->rnw || (cmd->id & I3C_CCC_DIRECT)) &&
> + (!cmd->dests || !cmd->ndests))
> return -EINVAL;
>
> if (master->ops->supports_ccc_cmd &&
> --
> 2.49.GIT
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i3c: master: require dests for read CCC commands
2026-07-23 9:23 [PATCH] i3c: master: require dests for read CCC commands Adrian Ng Ho Yin
2026-07-23 12:37 ` Mukesh Savaliya
2026-07-23 18:17 ` Frank Li
@ 2026-07-30 14:42 ` Alexandre Belloni
2 siblings, 0 replies; 4+ messages in thread
From: Alexandre Belloni @ 2026-07-30 14:42 UTC (permalink / raw)
To: Frank Li, linux-i3c, linux-kernel, Adrian Ng Ho Yin
Cc: tze.yee.ng, lkp, Dan Carpenter
On Thu, 23 Jul 2026 17:23:10 +0800, Adrian Ng Ho Yin wrote:
> Read CCC commands (rnw set) always need a destination array to store
> payload data. Extend the existing direct-CCC validation so cmd->dests
> is guaranteed non-NULL when cmd->rnw is set.
Applied, thanks!
[1/1] i3c: master: require dests for read CCC commands
https://git.kernel.org/i3c/c/2a99006d4403
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-30 14:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-23 9:23 [PATCH] i3c: master: require dests for read CCC commands Adrian Ng Ho Yin
2026-07-23 12:37 ` Mukesh Savaliya
2026-07-23 18:17 ` Frank Li
2026-07-30 14:42 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®