Hi Suzuki,

> -----Original Message-----
> From: Suzuki K Poulose [mailto:suzuki.poul...@arm.com]
> Sent: 11 January 2019 09:42
> To: Shameerali Kolothum Thodi <shameerali.kolothum.th...@huawei.com>;
> marc.zyng...@arm.com; linux-kernel@vger.kernel.org
> Cc: shank...@codeaurora.org; ganapatrao.kulka...@cavium.com;
> robert.rich...@cavium.com; Guohanjun (Hanjun Guo)
> <guohan...@huawei.com>; John Garry <john.ga...@huawei.com>;
> linux-arm-ker...@lists.infradead.org; Linuxarm <linux...@huawei.com>
> Subject: Re: [PATCH v3] irqchip: gicv3-its: Use NUMA aware memory allocation
> for ITS tables
> 

[...]

> >   drivers/irqchip/irq-gic-v3-its.c | 20 ++++++++++++--------
> >   1 file changed, 12 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/irqchip/irq-gic-v3-its.c 
> > b/drivers/irqchip/irq-gic-v3-its.c
> > index db20e99..ab01061 100644
> > --- a/drivers/irqchip/irq-gic-v3-its.c
> > +++ b/drivers/irqchip/irq-gic-v3-its.c
> > @@ -1749,7 +1749,8 @@ static int its_setup_baser(struct its_node *its,
> struct its_baser *baser,
> >             order = get_order(GITS_BASER_PAGES_MAX * psz);
> >     }
> >
> > -   base = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, order);
> > +   base = (void *)page_address(alloc_pages_node(its->numa_node,
> > +                               GFP_KERNEL | __GFP_ZERO, order));
> 
> If alloc_pages_node() fails, the page_address() could crash the system.
> 
> > -   its->cmd_base = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
> > -                                           get_order(ITS_CMD_QUEUE_SZ));
> > +   its->cmd_base = (void
> *)page_address(alloc_pages_node(its->numa_node,
> > +                                        GFP_KERNEL | __GFP_ZERO,
> > +                                        get_order(ITS_CMD_QUEUE_SZ)));
> 
> Similarly here. We may want to handle it properly.

Ah..good catch. I will change it and rebase on top of 5.0-rc1 as suggested by 
Marc.

Thanks,
Shameer

Reply via email to