Re: [PATCH v3] soc: qcom: icc-bwmon: Fix handling dev_pm_opp_find_bw_*() errors

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

 



…
> let's make the code just obvious to silence warning reported by Smatch:
> 
>   icc-bwmon.c:693 bwmon_intr_thread() error: 'target_opp' dereferencing possible ERR_PTR()
…

How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?


…
> +++ b/drivers/soc/qcom/icc-bwmon.c
> @@ -656,6 +656,9 @@ static irqreturn_t bwmon_intr_thread(int irq, void *dev_id)
>  	if (IS_ERR(target_opp) && PTR_ERR(target_opp) == -ERANGE)
>  		target_opp = dev_pm_opp_find_bw_floor(bwmon->dev, &bw_kbps, 0);
>  
> +	if (IS_ERR(target_opp))
> +		return IRQ_HANDLED;
> +
>  	bwmon->target_kbps = bw_kbps;
…

Would you like to avoid a duplicate condition check here?

	if (IS_ERR(target_opp) {
		if (PTR_ERR(target_opp) == -ERANGE)
			target_opp = dev_pm_opp_find_bw_floor(bwmon->dev, &bw_kbps, 0);

		return IRQ_HANDLED;
	}


Regards,
Markus





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux