lkml.org 
[lkml]   [2019]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] soc: fsl: dpio: fix cpu range check
On Sun, Jan 13, 2019 at 11:13 PM Bharat Bhushan <bharat.bhushan@nxp.com> wrote:
>
> cpu_possible(cpu) will always return true when cpu parameter
> is from cpumask_next().
> Check for nr_cpu_ids rather than !cpu_possible(cpu).

There is another patch pending merge seems to cover this issue too.
Please let me know if it doesn't.

https://lore.kernel.org/patchwork/patch/1020905/

Leo
>
> Signed-off-by: Bharat Bhushan <Bharat.Bhushan@nxp.com>
> ---
> drivers/soc/fsl/dpio/dpio-driver.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soc/fsl/dpio/dpio-driver.c b/drivers/soc/fsl/dpio/dpio-driver.c
> index e58fcc9096e8..eb369dd9e0a7 100644
> --- a/drivers/soc/fsl/dpio/dpio-driver.c
> +++ b/drivers/soc/fsl/dpio/dpio-driver.c
> @@ -133,7 +133,7 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev)
> else
> next_cpu = cpumask_next(next_cpu, cpu_online_mask);
>
> - if (!cpu_possible(next_cpu)) {
> + if (next_cpu >= nr_cpu_ids) {
> dev_err(dev, "probe failed. Number of DPIOs exceeds NR_CPUS.\n");
> err = -ERANGE;
> goto err_allocate_irqs;
> --
> 2.20.1
>

\
 
 \ /
  Last update: 2019-01-14 20:18    [W:0.141 / U:1.996 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site