Re: [PATCH] Fix potential NULL pointer error in sdhci_calc_sw_timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/07/2022 09:03, Chanwoo Lee wrote:
> From: ChanWoo Lee <cw9316.lee@xxxxxxxxxxx>

Use subsystem prefix in the subject. git log --oneline --

> 
> In sdhci_cqe_enable(), a NULL value is used as an argument.
> 
> * sdhci_set_timeout(host, NULL);
>  -> __sdhci_set_timeout(host, cmd);
>     -> sdhci_calc_sw_timeout(host,cmd)
> 
> The current code doesn't have any problems with the 'too_big' variable.
> -------------------------------------------------------------------------
> void __sdhci_set_timeout(struct sdhci_host *host, struct mmc_command *cmd)
> {
>         bool too_big = false;
>         u8 count = sdhci_calc_timeout(host, cmd, &too_big);
> 
>         if (too_big &&
>             host->quirks2 & SDHCI_QUIRK2_DISABLE_HW_TIMEOUT) {
>                 sdhci_calc_sw_timeout(host, cmd);
> }
> ------------------------------------------------------------------------
> 
> However, if the code related to the 'too_big' variable changes
> a null value may be used in the sdhci_calc_sw_timeout function.

I don't get this part. Did you mean, that if someone changes the source
code, there will be null pointer? Then the subject is not accurate.
"Potential NULL ptr" means that it can happen now, in some conditions.
>From what you are saying, it cannot happen, right?

Best regards,
Krzysztof



[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux