Hi!
> > Yes, if all the consumers of mmc_command memset the structure to 0, there
> > will be no problem. But just reviewed the code, and found mmc_app_cmd() (in
> > sd_ops.c) didn't memset the command structure. So I think if we can make
> > sure all the command structures will be initialized before using it, that
> > would be better.
>
> I would say that CMD55 is not a command that utilizes the DAT line,
> again, so not setting cmd_timeout itself is not a problem.
> 
> However, using uninitialized data is nasty, and can lead to problems
> if cmd->data ever happens to be not NULL.
> I'll send a patch for this tomorrow. Thanks for catching this. I'm
> curious if this is the reason behind Cyril's problem.
> 
> Cyril can you try modifying mmc_app_cmd like this? Does that do
> anything for you?
> 
> static int mmc_app_cmd(struct mmc_host *host, struct mmc_card *card)
> {
>         int err;
>         struct mmc_command cmd;
> 
>         BUG_ON(!host);
>         BUG_ON(card && (card->host != host));
> 
> +      memset(&cmd, 0, sizeof(struct mmc_command));
>         cmd.opcode = MMC_APP_CMD;
>

Not really, it behaves same regardless the memset().

-- 
metan 
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to